Added error handling and moved glEnable(GL_TEXTURE_2D) to fix issue 484
This commit is contained in:
+108
-34
@@ -42,6 +42,14 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define checkGlError() \
|
||||||
|
{ \
|
||||||
|
GLenum glError = glGetError(); \
|
||||||
|
if(glError != 0) \
|
||||||
|
printf("%s : %u : GLerror is %u\n", __FUNCTION__, __LINE__, glError); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//#define FORCE_GL2
|
//#define FORCE_GL2
|
||||||
#ifdef FORCE_GL2
|
#ifdef FORCE_GL2
|
||||||
// This code is to force the windows code to use GL_VERSION_2_0 even if it's not defined in the header files
|
// This code is to force the windows code to use GL_VERSION_2_0 even if it's not defined in the header files
|
||||||
@@ -338,16 +346,19 @@ JTexture::JTexture()
|
|||||||
|
|
||||||
JTexture::~JTexture()
|
JTexture::~JTexture()
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
if (mTexId != (GLuint)-1)
|
if (mTexId != (GLuint)-1)
|
||||||
glDeleteTextures(1, &mTexId);
|
glDeleteTextures(1, &mTexId);
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits)
|
void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
JRenderer::GetInstance()->BindTexture(this);
|
JRenderer::GetInstance()->BindTexture(this);
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bits);
|
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bits);
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
@@ -568,6 +579,7 @@ void esOrtho(ESMatrix *result, float left, float right, float bottom, float top,
|
|||||||
//
|
//
|
||||||
GLuint esLoadShader ( GLenum type, const char *shaderSrc )
|
GLuint esLoadShader ( GLenum type, const char *shaderSrc )
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
GLuint shader;
|
GLuint shader;
|
||||||
GLint compiled;
|
GLint compiled;
|
||||||
|
|
||||||
@@ -606,6 +618,7 @@ GLuint esLoadShader ( GLenum type, const char *shaderSrc )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkGlError();
|
||||||
return shader;
|
return shader;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -619,6 +632,8 @@ GLuint esLoadShader ( GLenum type, const char *shaderSrc )
|
|||||||
//
|
//
|
||||||
GLuint esLoadProgram ( const char *vertShaderSrc, const char *fragShaderSrc )
|
GLuint esLoadProgram ( const char *vertShaderSrc, const char *fragShaderSrc )
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
|
|
||||||
GLuint vertexShader;
|
GLuint vertexShader;
|
||||||
GLuint fragmentShader;
|
GLuint fragmentShader;
|
||||||
GLuint programObject;
|
GLuint programObject;
|
||||||
@@ -675,6 +690,8 @@ GLuint esLoadProgram ( const char *vertShaderSrc, const char *fragShaderSrc )
|
|||||||
glDeleteShader ( vertexShader );
|
glDeleteShader ( vertexShader );
|
||||||
glDeleteShader ( fragmentShader );
|
glDeleteShader ( fragmentShader );
|
||||||
|
|
||||||
|
checkGlError();
|
||||||
|
|
||||||
return programObject;
|
return programObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,6 +699,7 @@ GLuint esLoadProgram ( const char *vertShaderSrc, const char *fragShaderSrc )
|
|||||||
|
|
||||||
void JRenderer::InitRenderer()
|
void JRenderer::InitRenderer()
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
mCurrentTextureFilter = TEX_FILTER_NONE;
|
mCurrentTextureFilter = TEX_FILTER_NONE;
|
||||||
mImageFilter = NULL;
|
mImageFilter = NULL;
|
||||||
|
|
||||||
@@ -773,10 +791,12 @@ void JRenderer::InitRenderer()
|
|||||||
// Get the sampler location
|
// Get the sampler location
|
||||||
prog2_samplerLoc = glGetUniformLocation ( prog2, "s_texture" );
|
prog2_samplerLoc = glGetUniformLocation ( prog2, "s_texture" );
|
||||||
#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JRenderer::DestroyRenderer()
|
void JRenderer::DestroyRenderer()
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
// Delete program object
|
// Delete program object
|
||||||
glDeleteProgram ( prog1 );
|
glDeleteProgram ( prog1 );
|
||||||
@@ -798,17 +818,20 @@ void JRenderer::BeginScene()
|
|||||||
float scaleW = (float)actualWidth/SCREEN_WIDTH_F;
|
float scaleW = (float)actualWidth/SCREEN_WIDTH_F;
|
||||||
glScalef(scaleW,scaleW,1.f);
|
glScalef(scaleW,scaleW,1.f);
|
||||||
#endif
|
#endif
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::EndScene()
|
void JRenderer::EndScene()
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
glFlush ();
|
glFlush ();
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JRenderer::BindTexture(JTexture *tex)
|
void JRenderer::BindTexture(JTexture *tex)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
if (mCurrentTex != tex->mTexId)
|
if (mCurrentTex != tex->mTexId)
|
||||||
{
|
{
|
||||||
mCurrentTex = tex->mTexId;
|
mCurrentTex = tex->mTexId;
|
||||||
@@ -830,6 +853,7 @@ void JRenderer::BindTexture(JTexture *tex)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -852,6 +876,8 @@ void Swap(float *a, float *b)
|
|||||||
|
|
||||||
void JRenderer::RenderQuad(JQuad* quad, float xo, float yo, float angle, float xScale, float yScale)
|
void JRenderer::RenderQuad(JQuad* quad, float xo, float yo, float angle, float xScale, float yScale)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
|
|
||||||
//yo = SCREEN_HEIGHT-yo-1;//-(quad->mHeight);
|
//yo = SCREEN_HEIGHT-yo-1;//-(quad->mHeight);
|
||||||
float width = quad->mWidth;
|
float width = quad->mWidth;
|
||||||
float height = quad->mHeight;
|
float height = quad->mHeight;
|
||||||
@@ -1019,12 +1045,13 @@ void JRenderer::RenderQuad(JQuad* quad, float xo, float yo, float angle, float x
|
|||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::RenderQuad(JQuad* quad, VertexColor* pt)
|
void JRenderer::RenderQuad(JQuad* quad, VertexColor* pt)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
|
|
||||||
for (int i=0;i<4;i++)
|
for (int i=0;i<4;i++)
|
||||||
{
|
{
|
||||||
@@ -1117,17 +1144,19 @@ void JRenderer::RenderQuad(JQuad* quad, VertexColor* pt)
|
|||||||
|
|
||||||
//glDisable(GL_BLEND);
|
//glDisable(GL_BLEND);
|
||||||
|
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE color)
|
void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
|
|
||||||
y = SCREEN_HEIGHT_F - y - height;
|
y = SCREEN_HEIGHT_F - y - height;
|
||||||
|
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
GLfloat vVertices[] = {
|
GLfloat vVertices[] = {
|
||||||
x, y+height, 0.0f,
|
x, y+height, 0.0f,
|
||||||
@@ -1161,6 +1190,7 @@ void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE
|
|||||||
|
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP,0,4);
|
glDrawArrays(GL_TRIANGLE_STRIP,0,4);
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
|
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
@@ -1179,21 +1209,23 @@ void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE
|
|||||||
glEnd();
|
glEnd();
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE color)
|
void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
|
|
||||||
y = SCREEN_HEIGHT_F - y - height;
|
y = SCREEN_HEIGHT_F - y - height;
|
||||||
|
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
GLfloat vVertices[] = {
|
GLfloat vVertices[] = {
|
||||||
x, y, 0.0f,
|
x, y, 0.0f,
|
||||||
@@ -1227,6 +1259,7 @@ void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE
|
|||||||
|
|
||||||
glDrawArrays(GL_LINE_LOOP,0,4);
|
glDrawArrays(GL_LINE_LOOP,0,4);
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
|
|
||||||
@@ -1246,9 +1279,10 @@ void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE
|
|||||||
|
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1264,10 +1298,9 @@ void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE
|
|||||||
|
|
||||||
void JRenderer::FillRect(float x, float y, float width, float height, JColor* colors)
|
void JRenderer::FillRect(float x, float y, float width, float height, JColor* colors)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
y = SCREEN_HEIGHT_F - y - height;
|
y = SCREEN_HEIGHT_F - y - height;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
GLfloat vVertices[] = {
|
GLfloat vVertices[] = {
|
||||||
x, y+height, 0.0f,
|
x, y+height, 0.0f,
|
||||||
@@ -1301,6 +1334,7 @@ void JRenderer::FillRect(float x, float y, float width, float height, JColor* co
|
|||||||
|
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP,0,4);
|
glDrawArrays(GL_TRIANGLE_STRIP,0,4);
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
// top left corner
|
// top left corner
|
||||||
glColor4ub(colors[0].r, colors[0].g, colors[0].b, colors[0].a);
|
glColor4ub(colors[0].r, colors[0].g, colors[0].b, colors[0].a);
|
||||||
@@ -1322,17 +1356,18 @@ void JRenderer::FillRect(float x, float y, float width, float height, JColor* co
|
|||||||
|
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
|
||||||
//glDisable(GL_BLEND);
|
//glDisable(GL_BLEND);
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color)
|
void JRenderer::DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
// glLineWidth (mLineWidth);
|
// glLineWidth (mLineWidth);
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
@@ -1364,19 +1399,22 @@ void JRenderer::DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE colo
|
|||||||
|
|
||||||
glDrawArrays(GL_LINES,0,2);
|
glDrawArrays(GL_LINES,0,2);
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
glVertex2f(x1, SCREEN_HEIGHT_F-y1);
|
glVertex2f(x1, SCREEN_HEIGHT_F-y1);
|
||||||
glVertex2f(x2, SCREEN_HEIGHT_F-y2);
|
glVertex2f(x2, SCREEN_HEIGHT_F-y2);
|
||||||
glEnd();
|
glEnd();
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::Plot(float x, float y, PIXEL_TYPE color)
|
void JRenderer::Plot(float x, float y, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
@@ -1390,11 +1428,13 @@ void JRenderer::Plot(float x, float y, PIXEL_TYPE color)
|
|||||||
// FIXME, not used
|
// FIXME, not used
|
||||||
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color)
|
void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
@@ -1409,6 +1449,7 @@ void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color)
|
|||||||
// FIXME, not used
|
// FIXME, not used
|
||||||
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1645,11 +1686,12 @@ JTexture* JRenderer::LoadTexture(const char* filename, int mode, int TextureForm
|
|||||||
tex->mTexHeight = textureInfo.mTexHeight;
|
tex->mTexHeight = textureInfo.mTexHeight;
|
||||||
|
|
||||||
GLuint texid;
|
GLuint texid;
|
||||||
|
checkGlError();
|
||||||
glGenTextures(1, &texid);
|
glGenTextures(1, &texid);
|
||||||
tex->mTexId = texid;
|
tex->mTexId = texid;
|
||||||
GLenum glError = glGetError();
|
// glError = glGetError();
|
||||||
|
|
||||||
if (/*texid*/ glError == 0)
|
if (1)///*texid*/ glError == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
// OpenGL texture has (0,0) at lower-left
|
// OpenGL texture has (0,0) at lower-left
|
||||||
@@ -1688,10 +1730,8 @@ JTexture* JRenderer::LoadTexture(const char* filename, int mode, int TextureForm
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("TextureId is 0, GLerror is %u\n", glError);
|
// printf("LoadTexture> TextureId is 0, GLerror is %u\n", glError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] textureInfo.mBits;
|
delete [] textureInfo.mBits;
|
||||||
@@ -1704,6 +1744,8 @@ JTexture* JRenderer::LoadTexture(const char* filename, int mode, int TextureForm
|
|||||||
tex = NULL;
|
tex = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
checkGlError();
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2002,6 +2044,7 @@ void JRenderer::LoadGIF(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
|
|
||||||
JTexture* JRenderer::CreateTexture(int width, int height, int mode __attribute__((unused)))
|
JTexture* JRenderer::CreateTexture(int width, int height, int mode __attribute__((unused)))
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
int size = width * height * sizeof(PIXEL_TYPE); // RGBA
|
int size = width * height * sizeof(PIXEL_TYPE); // RGBA
|
||||||
|
|
||||||
BYTE* buffer = new BYTE[size];
|
BYTE* buffer = new BYTE[size];
|
||||||
@@ -2030,6 +2073,7 @@ JTexture* JRenderer::CreateTexture(int width, int height, int mode __attribute__
|
|||||||
|
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
|
|
||||||
|
checkGlError();
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2048,6 +2092,7 @@ void JRenderer::EnableVSync(bool flag __attribute__((unused)))
|
|||||||
|
|
||||||
void JRenderer::ClearScreen(PIXEL_TYPE color)
|
void JRenderer::ClearScreen(PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
@@ -2055,11 +2100,13 @@ void JRenderer::ClearScreen(PIXEL_TYPE color)
|
|||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
// FillRect(0.0f, 0.0f, SCREEN_WIDTH_F, SCREEN_HEIGHT_F, color);
|
// FillRect(0.0f, 0.0f, SCREEN_WIDTH_F, SCREEN_HEIGHT_F, color);
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::SetTexBlend(int src, int dest)
|
void JRenderer::SetTexBlend(int src, int dest)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
if (src != mCurrTexBlendSrc || dest != mCurrTexBlendDest)
|
if (src != mCurrTexBlendSrc || dest != mCurrTexBlendDest)
|
||||||
{
|
{
|
||||||
mCurrTexBlendSrc = src;
|
mCurrTexBlendSrc = src;
|
||||||
@@ -2067,31 +2114,37 @@ void JRenderer::SetTexBlend(int src, int dest)
|
|||||||
|
|
||||||
glBlendFunc(src, dest);
|
glBlendFunc(src, dest);
|
||||||
}
|
}
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::SetTexBlendSrc(int src)
|
void JRenderer::SetTexBlendSrc(int src)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
if (src != mCurrTexBlendSrc)
|
if (src != mCurrTexBlendSrc)
|
||||||
{
|
{
|
||||||
mCurrTexBlendSrc = src;
|
mCurrTexBlendSrc = src;
|
||||||
glBlendFunc(mCurrTexBlendSrc, mCurrTexBlendDest);
|
glBlendFunc(mCurrTexBlendSrc, mCurrTexBlendDest);
|
||||||
}
|
}
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::SetTexBlendDest(int dest)
|
void JRenderer::SetTexBlendDest(int dest)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
if (dest != mCurrTexBlendDest)
|
if (dest != mCurrTexBlendDest)
|
||||||
{
|
{
|
||||||
mCurrTexBlendDest = dest;
|
mCurrTexBlendDest = dest;
|
||||||
glBlendFunc(mCurrTexBlendSrc, mCurrTexBlendDest);
|
glBlendFunc(mCurrTexBlendSrc, mCurrTexBlendDest);
|
||||||
}
|
}
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::Enable2D()
|
void JRenderer::Enable2D()
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
if (mCurrentRenderMode == MODE_2D)
|
if (mCurrentRenderMode == MODE_2D)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -2111,6 +2164,7 @@ void JRenderer::Enable2D()
|
|||||||
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glDisable (GL_DEPTH_TEST);
|
glDisable (GL_DEPTH_TEST);
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2185,6 +2239,7 @@ void JRenderer::PopMatrix()
|
|||||||
|
|
||||||
void JRenderer::RenderTriangles(JTexture* texture, Vertex3D *vertices, int start, int count)
|
void JRenderer::RenderTriangles(JTexture* texture, Vertex3D *vertices, int start, int count)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
if (texture)
|
if (texture)
|
||||||
BindTexture(texture);
|
BindTexture(texture);
|
||||||
|
|
||||||
@@ -2247,6 +2302,7 @@ void JRenderer::RenderTriangles(JTexture* texture, Vertex3D *vertices, int start
|
|||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2258,10 +2314,10 @@ void JRenderer::SetFOV(float fov)
|
|||||||
|
|
||||||
void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
int i;
|
int i;
|
||||||
GLubyte* colors = new GLubyte[count*4];
|
GLubyte* colors = new GLubyte[count*4];
|
||||||
@@ -2304,6 +2360,7 @@ void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
|||||||
delete[] colors;
|
delete[] colors;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_TRIANGLE_FAN);
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
|
|
||||||
@@ -2315,18 +2372,19 @@ void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
|||||||
glEnd();
|
glEnd();
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
void JRenderer::DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
int i;
|
int i;
|
||||||
int number = count+1;
|
int number = count+1;
|
||||||
@@ -2373,6 +2431,7 @@ void JRenderer::DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
|||||||
delete[] vVertices;
|
delete[] vVertices;
|
||||||
delete[] colors;
|
delete[] colors;
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_LINE_STRIP);
|
glBegin(GL_LINE_STRIP);
|
||||||
|
|
||||||
@@ -2387,9 +2446,10 @@ void JRenderer::DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
|||||||
|
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2423,10 +2483,10 @@ void JRenderer::DrawLine(float x1, float y1, float x2, float y2, float lineWidth
|
|||||||
|
|
||||||
void JRenderer::DrawCircle(float x, float y, float radius, PIXEL_TYPE color)
|
void JRenderer::DrawCircle(float x, float y, float radius, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
int i, index;
|
int i, index;
|
||||||
const int number = 181;
|
const int number = 181;
|
||||||
@@ -2471,6 +2531,7 @@ void JRenderer::DrawCircle(float x, float y, float radius, PIXEL_TYPE color)
|
|||||||
|
|
||||||
glDrawArrays(GL_LINE_STRIP,0,number);
|
glDrawArrays(GL_LINE_STRIP,0,number);
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_LINE_STRIP);
|
glBegin(GL_LINE_STRIP);
|
||||||
|
|
||||||
@@ -2484,17 +2545,18 @@ void JRenderer::DrawCircle(float x, float y, float radius, PIXEL_TYPE color)
|
|||||||
glEnd();
|
glEnd();
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JRenderer::FillCircle(float x, float y, float radius, PIXEL_TYPE color)
|
void JRenderer::FillCircle(float x, float y, float radius, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
int i, index;
|
int i, index;
|
||||||
const int number = 182;
|
const int number = 182;
|
||||||
@@ -2543,6 +2605,7 @@ void JRenderer::FillCircle(float x, float y, float radius, PIXEL_TYPE color)
|
|||||||
|
|
||||||
glDrawArrays(GL_TRIANGLE_FAN,0,number);
|
glDrawArrays(GL_TRIANGLE_FAN,0,number);
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_TRIANGLE_FAN);
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
|
|
||||||
@@ -2559,14 +2622,16 @@ void JRenderer::FillCircle(float x, float y, float radius, PIXEL_TYPE color)
|
|||||||
|
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::DrawPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
|
void JRenderer::DrawPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
@@ -2574,7 +2639,6 @@ void JRenderer::DrawPolygon(float x, float y, float size, int count, float start
|
|||||||
float steps = 360.0f/count;
|
float steps = 360.0f/count;
|
||||||
size /= 2;
|
size /= 2;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
int i;
|
int i;
|
||||||
GLfloat* vVertices = new GLfloat[3*count];
|
GLfloat* vVertices = new GLfloat[3*count];
|
||||||
@@ -2619,6 +2683,7 @@ void JRenderer::DrawPolygon(float x, float y, float size, int count, float start
|
|||||||
delete[] vVertices;
|
delete[] vVertices;
|
||||||
delete[] colors;
|
delete[] colors;
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_LINE_LOOP);
|
glBegin(GL_LINE_LOOP);
|
||||||
|
|
||||||
@@ -2634,14 +2699,16 @@ void JRenderer::DrawPolygon(float x, float y, float size, int count, float start
|
|||||||
glEnd();
|
glEnd();
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::FillPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
|
void JRenderer::FillPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
@@ -2650,7 +2717,6 @@ void JRenderer::FillPolygon(float x, float y, float size, int count, float start
|
|||||||
float steps = 360.0f/count;
|
float steps = 360.0f/count;
|
||||||
size /= 2;
|
size /= 2;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
int i;
|
int i;
|
||||||
GLfloat* vVertices = new GLfloat[3*(count+2)];
|
GLfloat* vVertices = new GLfloat[3*(count+2)];
|
||||||
@@ -2703,6 +2769,7 @@ void JRenderer::FillPolygon(float x, float y, float size, int count, float start
|
|||||||
delete[] vVertices;
|
delete[] vVertices;
|
||||||
delete[] colors;
|
delete[] colors;
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_TRIANGLE_FAN);
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
|
|
||||||
@@ -2722,9 +2789,10 @@ void JRenderer::FillPolygon(float x, float y, float size, int count, float start
|
|||||||
|
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2737,12 +2805,12 @@ void JRenderer::SetImageFilter(JImageFilter* imageFilter)
|
|||||||
|
|
||||||
void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
|
void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
x+=w+radius;
|
x+=w+radius;
|
||||||
y+=h+radius;
|
y+=h+radius;
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
int i;
|
int i;
|
||||||
int number = 360;
|
int number = 360;
|
||||||
@@ -2808,6 +2876,7 @@ void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius,
|
|||||||
delete[] vVertices;
|
delete[] vVertices;
|
||||||
delete[] colors;
|
delete[] colors;
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_LINE_LOOP);
|
glBegin(GL_LINE_LOOP);
|
||||||
int i;
|
int i;
|
||||||
@@ -2847,22 +2916,23 @@ void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius,
|
|||||||
|
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
|
void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
|
||||||
{
|
{
|
||||||
|
checkGlError();
|
||||||
x+=w+radius;
|
x+=w+radius;
|
||||||
y+=radius;
|
y+=radius;
|
||||||
|
|
||||||
JColor col;
|
JColor col;
|
||||||
col.color = color;
|
col.color = color;
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
int i, offset;
|
int i, offset;
|
||||||
int number = 2+360;
|
int number = 2+360;
|
||||||
@@ -2918,11 +2988,13 @@ void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius,
|
|||||||
// Load the vertex position
|
// Load the vertex position
|
||||||
glVertexAttribPointer ( prog1_positionLoc, 3, GL_FLOAT,
|
glVertexAttribPointer ( prog1_positionLoc, 3, GL_FLOAT,
|
||||||
GL_FALSE, 3 * sizeof(GLfloat), vVertices );
|
GL_FALSE, 3 * sizeof(GLfloat), vVertices );
|
||||||
|
|
||||||
// Load the color
|
// Load the color
|
||||||
glVertexAttribPointer(prog1_colorLoc, 4, GL_UNSIGNED_BYTE,
|
glVertexAttribPointer(prog1_colorLoc, 4, GL_UNSIGNED_BYTE,
|
||||||
GL_TRUE, 4 * sizeof(GLubyte), colors);
|
GL_TRUE, 4 * sizeof(GLubyte), colors);
|
||||||
|
|
||||||
glEnableVertexAttribArray ( prog1_positionLoc );
|
glEnableVertexAttribArray ( prog1_positionLoc );
|
||||||
|
|
||||||
glEnableVertexAttribArray ( prog1_colorLoc );
|
glEnableVertexAttribArray ( prog1_colorLoc );
|
||||||
|
|
||||||
// Load the MVP matrix
|
// Load the MVP matrix
|
||||||
@@ -2933,6 +3005,8 @@ void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius,
|
|||||||
delete[] vVertices;
|
delete[] vVertices;
|
||||||
delete[] colors;
|
delete[] colors;
|
||||||
#else
|
#else
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
glColor4ub(col.r, col.g, col.b, col.a);
|
glColor4ub(col.r, col.g, col.b, col.a);
|
||||||
glBegin(GL_TRIANGLE_FAN);
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
|
|
||||||
@@ -2979,9 +3053,9 @@ void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius,
|
|||||||
|
|
||||||
// default color
|
// default color
|
||||||
glColor4ub(255, 255, 255, 255);
|
glColor4ub(255, 255, 255, 255);
|
||||||
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
#endif //#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
|
||||||
|
checkGlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user