The server tree of https://code.moenext.com/nanahira/ygopro.git, branch server, commit 52c868ce071ea0f2fcb0cf39bf2fb4151d12b90c, stock: gframe/, premake5.lua, .ci/, LICENSE, and gframe/ygopro.rc + .ico (upstream keeps them in resource/ and copies them in before building). No game assets, no scripts, no ocgcore submodule: the core is ../core. The third-party sources upstream's Windows CI downloads are vendored here at the positions its premake expects, each with its premake fragment from upstream's premake/ folder inside it: lua 5.4.8, sqlite 3.53.3, libevent 2.1.13-stable (tests, samples and autotools helpers left out; the files its Windows prebuild copies into include/ left out), zlib 1.3.2 (contrib and examples left out), xz 5.8.3 (src/liblzma + src/common only), and irrlicht 1.9 from mycard at 20f86d25: include/ plus the source/Irrlicht headers and the 11 .cpp files the server's zip reader project compiles. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
162 lines
4.6 KiB
C++
162 lines
4.6 KiB
C++
// Copyright (C) 2015 Patryk Nadrowski
|
|
// This file is part of the "Irrlicht Engine".
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
#ifndef IRR_I_RENDER_TARGET_H_INCLUDED
|
|
#define IRR_I_RENDER_TARGET_H_INCLUDED
|
|
|
|
#include "IReferenceCounted.h"
|
|
#include "EDriverTypes.h"
|
|
#include "irrArray.h"
|
|
|
|
namespace irr
|
|
{
|
|
namespace video
|
|
{
|
|
class ITexture;
|
|
|
|
//! Enumeration of cube texture surfaces
|
|
enum E_CUBE_SURFACE
|
|
{
|
|
ECS_POSX = 0,
|
|
ECS_NEGX,
|
|
ECS_POSY,
|
|
ECS_NEGY,
|
|
ECS_POSZ,
|
|
ECS_NEGZ
|
|
};
|
|
|
|
//! Structure for render target data internally used by drivers
|
|
/** This data can be retrieved by IRenderTarget::getExposedRenderTargetData().
|
|
Note that this structure does not contain any valid data if the driver
|
|
does not return any exposed data.
|
|
*/
|
|
struct SExposedRenderTargetData
|
|
{
|
|
SExposedRenderTargetData() {OpenGL.FramebufferName = 0;}
|
|
|
|
// For OpenGL driver types
|
|
struct SOpenGL
|
|
{
|
|
unsigned int FramebufferName; // GLuint: Name of the framebuffer object name for the render target
|
|
};
|
|
|
|
union // union as more types my be useful in future (same as in similar exposed data structures)
|
|
{
|
|
SOpenGL OpenGL;
|
|
};
|
|
};
|
|
|
|
//! Interface of a Render Target.
|
|
class IRenderTarget : public virtual IReferenceCounted
|
|
{
|
|
public:
|
|
|
|
//! constructor
|
|
IRenderTarget() : DepthStencil(0), DriverType(EDT_NULL)
|
|
{
|
|
}
|
|
|
|
//! Returns an array of previously set textures.
|
|
const core::array<ITexture*>& getTexture() const
|
|
{
|
|
return Textures;
|
|
}
|
|
|
|
//! Returns a of previously set depth / depth-stencil texture.
|
|
ITexture* getDepthStencil() const
|
|
{
|
|
return DepthStencil;
|
|
}
|
|
|
|
//! Returns an array of active surface for cube textures
|
|
const core::array<E_CUBE_SURFACE>& getCubeSurfaces() const
|
|
{
|
|
return CubeSurfaces;
|
|
}
|
|
|
|
//! Set multiple textures.
|
|
/** Set multiple textures for the render target.
|
|
\param texture Array of texture objects. These textures are used for a color outputs.
|
|
\param depthStencil Depth or packed depth-stencil texture. This texture is used as depth
|
|
or depth-stencil buffer. You can pass getDepthStencil() if you don't want to change it.
|
|
\param cubeSurfaces When rendering to cube textures, set the surface to be used for each texture. Can be empty otherwise.
|
|
*/
|
|
void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces = core::array<E_CUBE_SURFACE>())
|
|
{
|
|
setTextures(texture.const_pointer(), texture.size(), depthStencil, cubeSurfaces.const_pointer(), cubeSurfaces.size());
|
|
}
|
|
|
|
//! Sets one texture + depthStencil
|
|
//! You can pass getDepthStencil() for depthStencil if you don't want to change that one
|
|
void setTexture(ITexture* texture, ITexture* depthStencil)
|
|
{
|
|
if ( texture )
|
|
{
|
|
setTextures(&texture, 1, depthStencil);
|
|
}
|
|
else
|
|
{
|
|
setTextures(0, 0, depthStencil);
|
|
}
|
|
}
|
|
|
|
//! Set one cube surface texture.
|
|
void setTexture(ITexture* texture, ITexture* depthStencil, E_CUBE_SURFACE cubeSurface)
|
|
{
|
|
if ( texture )
|
|
{
|
|
setTextures(&texture, 1, depthStencil, &cubeSurface, 1);
|
|
}
|
|
else
|
|
{
|
|
setTextures(0, 0, depthStencil, &cubeSurface, 1);
|
|
}
|
|
}
|
|
|
|
//! Get driver type of render target.
|
|
E_DRIVER_TYPE getDriverType() const
|
|
{
|
|
return DriverType;
|
|
}
|
|
|
|
//! Returns driver specific data about the IRenderTarget
|
|
/** This can be useful when interacting with other libraries
|
|
or working with low level driver functions directly.
|
|
Note that not all drivers will return anything useful.
|
|
\return Collection of drive specific texture data */
|
|
virtual SExposedRenderTargetData getExposedRenderTargetData() const
|
|
{
|
|
return SExposedRenderTargetData(); // dummy without any useful data
|
|
}
|
|
|
|
|
|
protected:
|
|
|
|
//! Set multiple textures.
|
|
// NOTE: working with pointers instead of arrays to avoid unnecessary memory allocations for the single textures case
|
|
virtual void setTextures(ITexture* const * textures, u32 numTextures, ITexture* depthStencil, const E_CUBE_SURFACE* cubeSurfaces=0, u32 numCubeSurfaces=0) = 0;
|
|
|
|
//! Textures assigned to render target.
|
|
core::array<ITexture*> Textures;
|
|
|
|
//! Depth or packed depth-stencil texture assigned to render target.
|
|
ITexture* DepthStencil;
|
|
|
|
//! Active surface of cube textures
|
|
core::array<E_CUBE_SURFACE> CubeSurfaces;
|
|
|
|
//! Driver type of render target.
|
|
E_DRIVER_TYPE DriverType;
|
|
|
|
private:
|
|
// no copying (IReferenceCounted still allows that for reasons which take some time to work around)
|
|
IRenderTarget(const IRenderTarget&);
|
|
IRenderTarget& operator=(const IRenderTarget&);
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif
|