[opengl] Temporarily added additional debug logs

This commit is contained in:
Alex Zolotarev 2012-01-18 11:09:29 +03:00 committed by Alex Zolotarev
parent 002d12f467
commit 058794cd1f
6 changed files with 35 additions and 2 deletions

View file

@ -13,8 +13,10 @@ namespace yg
void BaseTexture::init() const
{
OGLCHECK(glGenTextures(1, &m_id));
LOG(LDEBUG, ("glGenTextures", m_id));
OGLCHECK(glBindTexture(GL_TEXTURE_2D, m_id));
LOG(LDEBUG, ("glBindTexture", m_id));
OGLCHECK(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT));
OGLCHECK(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT));
@ -73,6 +75,7 @@ namespace yg
{
int id;
OGLCHECK(glGetIntegerv(GL_TEXTURE_BINDING_2D, &id));
LOG(LDEBUG, ("glGetIntegerv", id));
return id;
}
@ -81,10 +84,11 @@ namespace yg
if (queue)
queue->processFn(bind(&BaseTexture::makeCurrent, this, (yg::gl::PacketsQueue*)0));
#ifndef OMIM_OS_ANDROID
if (current() != m_id)
#endif
{
OGLCHECK(glBindTexture(GL_TEXTURE_2D, m_id));
LOG(LDEBUG, ("glBindTexture", m_id));
}
}
unsigned BaseTexture::id() const

View file

@ -19,6 +19,7 @@ namespace yg
{
int id;
OGLCHECK(glGetIntegerv(GL_FRAMEBUFFER_BINDING_MWM, &id));
LOG(LDEBUG, ("glGetIntegerv", id));
return id;
}
@ -27,7 +28,10 @@ namespace yg
if (defaultFB)
m_id = 0;
else
{
OGLCHECK(glGenFramebuffersFn(1, &m_id));
LOG(LDEBUG, ("glGenFramebuffers", m_id));
}
}
FrameBuffer::~FrameBuffer()
@ -39,7 +43,10 @@ namespace yg
void FrameBuffer::makeCurrent()
{
if (m_id != current())
{
OGLCHECK(glBindFramebufferFn(GL_FRAMEBUFFER_MWM, m_id));
LOG(LDEBUG, ("glBindFramebuffer", m_id));
}
if (m_depthBuffer)
m_depthBuffer->attachToFrameBuffer();

View file

@ -18,6 +18,7 @@ namespace yg
{
int id;
OGLCHECK(glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &id));
LOG(LDEBUG, ("glGetIntegerv", id));
return id;
}

View file

@ -18,6 +18,7 @@ namespace yg
{
int id;
OGLCHECK(glGetIntegerv(GL_RENDERBUFFER_BINDING_MWM, &id));
LOG(LDEBUG, ("glGetIntegerv", id));
return id;
}
@ -27,6 +28,7 @@ namespace yg
// if (!m_isDepthBuffer)
{
OGLCHECK(glGenRenderbuffersFn(1, &m_id));
LOG(LDEBUG, ("glGenRenderbuffers", m_id));
makeCurrent();
@ -37,6 +39,8 @@ namespace yg
internalFormat,
m_width,
m_height));
LOG(LDEBUG, ("glRenderbufferStorage", m_isDepthBuffer ? "GL_DEPTH_COMPONENT16_MWM" : "GL_RGBA8_MWM",
m_width, m_height));
}
/* else
{
@ -105,7 +109,10 @@ namespace yg
void RenderBuffer::makeCurrent() const
{
if (m_id != current())
{
OGLCHECK(glBindRenderbufferFn(GL_RENDERBUFFER_MWM, m_id));
LOG(LDEBUG, ("glBindRenderbuffer", m_id));
}
}
bool RenderBuffer::isDepthBuffer() const

View file

@ -14,6 +14,7 @@ namespace yg
void setupCoordinates(size_t width, size_t height, bool doSwap /*= true*/)
{
OGLCHECK(glViewport(0, 0, width, height));
LOG(LDEBUG, ("glViewport", width, height));
OGLCHECK(glMatrixMode(GL_MODELVIEW));
OGLCHECK(glLoadIdentity());
@ -23,14 +24,26 @@ namespace yg
#ifdef OMIM_GL_ES
if (!doSwap)
{
OGLCHECK(glOrthof(0, width, 0, height, -yg::maxDepth, yg::maxDepth));
LOG(LDEBUG, ("glOrthof", 0, width, 0, height, -yg::maxDepth, yg::maxDepth));
}
else
{
OGLCHECK(glOrthof(0, width, height, 0, -yg::maxDepth, yg::maxDepth));
LOG(LDEBUG, ("glOrthof", 0, width, height, 0, -yg::maxDepth, yg::maxDepth));
}
#else
if (!doSwap)
{
OGLCHECK(glOrtho(0, width, 0, height, -yg::maxDepth, yg::maxDepth));
LOG(LDEBUG, ("glOrtho", 0, width, 0, height, -yg::maxDepth, yg::maxDepth));
}
else
{
OGLCHECK(glOrtho(0, width, height, 0, -yg::maxDepth, yg::maxDepth));
LOG(LDEBUG, ("glOrtho", 0, width, height, 0, -yg::maxDepth, yg::maxDepth));
}
#endif
}
}

View file

@ -18,6 +18,7 @@ namespace yg
{
int id;
OGLCHECK(glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &id));
LOG(LDEBUG, ("glGetIntegerv", id));
return id;
}