19 std::vector<GL4TextureRT*>& rtTextures,
GL4TextureDS* dsTexture)
27 "DrawTargets has more targets than there are RT textures provided.");
33 std::vector<GEObject*>& rtTextures,
GEObject* dsTexture)
35 std::vector<GL4TextureRT*> dxRTTextures(rtTextures.size());
36 for (
size_t i = 0; i < rtTextures.size(); ++i)
38 dxRTTextures[i] =
static_cast<GL4TextureRT*
>(rtTextures[i]);
42 return std::make_shared<GL4DrawTarget>(
target, dxRTTextures, dxDSTexture);
62 glViewport(0, 0, viewportWidth, viewportHeight);
79 std::vector<GLenum> useDrawBuffers(numTargets);
80 for (
unsigned i = 0; i < numTargets; ++i)
84 useDrawBuffers[i] = colorTarget;
91 glDrawBuffers(static_cast<GLsizei>(useDrawBuffers.size()), useDrawBuffers.data());
106 for (
unsigned i = 0; i < numTargets; ++i)
109 if (textureRT->CanAutoGenerateMipmaps())
111 textureRT->GenerateMipmaps();
unsigned int GetWidth() const
void APIENTRY glBindFramebuffer(GLenum target, GLuint framebuffer)
void APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
unsigned int GetHeight() const
GLsizei mSaveViewportHeight
void APIENTRY glDepthRange(GLdouble near, GLdouble far)
#define LogAssert(condition, message)
static std::shared_ptr< GEDrawTarget > Create(DrawTarget const *target, std::vector< GEObject * > &rtTextures, GEObject *dsTexture)
GLdouble mSaveViewportFar
GL4TextureDS * mDSTexture
void APIENTRY glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
#define GL_COLOR_ATTACHMENT0
GL4DrawTarget(DrawTarget const *target, std::vector< GL4TextureRT * > &rtTextures, GL4TextureDS *dsTexture)
void APIENTRY glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
unsigned int GetNumTargets() const
GLdouble mSaveViewportNear
GLsizei mSaveViewportWidth
#define GL_DEPTH_STENCIL_ATTACHMENT
void APIENTRY glDrawBuffers(GLsizei n, const GLenum *bufs)
void APIENTRY glGetIntegerv(GLenum pname, GLint *data)
#define GL_DRAW_FRAMEBUFFER
void APIENTRY glGetDoublev(GLenum pname, GLdouble *data)
std::vector< GL4TextureRT * > mRTTextures
void APIENTRY glGenFramebuffers(GLsizei n, GLuint *framebuffers)
GLuint GetGLHandle() const