|
@@ -405,10 +405,11 @@ int tnsNewVertexShader(char *Content){
|
|
|
glCompileShader(VertexShaderObject);
|
|
|
glGetShaderiv(VertexShaderObject, GL_COMPILE_STATUS, &status);
|
|
|
if (status == GL_FALSE){
|
|
|
- glGetShaderInfoLog(VertexShaderObject, sizeof(error), 0, error);
|
|
|
- printf("Vertex shader error:\n%s", error);
|
|
|
+ glGetShaderInfoLog(VertexShaderObject, sizeof(error), 0, error); logPrint("Vertex shader error:\n%s", error);
|
|
|
glDeleteShader(VertexShaderObject); free(UseContent);
|
|
|
return -1;
|
|
|
+ } else {
|
|
|
+ glGetShaderInfoLog(VertexShaderObject, sizeof(error), 0, error); if(error[0]) logPrint("Vertex shader info:\n%s", error);
|
|
|
}
|
|
|
free(UseContent);
|
|
|
|
|
@@ -429,10 +430,11 @@ int tnsNewFragmentShaderMaterial(char *Content, char* Library, char* Material){
|
|
|
glCompileShader(FragmentShaderObject);
|
|
|
glGetShaderiv(FragmentShaderObject, GL_COMPILE_STATUS, &status);
|
|
|
if (status == GL_FALSE){
|
|
|
- glGetShaderInfoLog(FragmentShaderObject, sizeof(error), 0, error);
|
|
|
- printf("Fragment shader error:\n%s", error);
|
|
|
+ glGetShaderInfoLog(FragmentShaderObject, sizeof(error), 0, error); logPrint("Fragment shader error:\n%s", error);
|
|
|
glDeleteShader(FragmentShaderObject); free(UseContent);
|
|
|
return -1;
|
|
|
+ } else {
|
|
|
+ glGetShaderInfoLog(FragmentShaderObject, sizeof(error), 0, error); if (error[0]) logPrint("Fragment shader info:\n%s", error);
|
|
|
}
|
|
|
free(UseContent);
|
|
|
|
|
@@ -457,10 +459,11 @@ int tnsNewGeometryShader(char *Content){
|
|
|
glCompileShader(GeometryShaderObject);
|
|
|
glGetShaderiv(GeometryShaderObject, GL_COMPILE_STATUS, &status);
|
|
|
if (status == GL_FALSE){
|
|
|
- glGetShaderInfoLog(GeometryShaderObject, sizeof(error), 0, error);
|
|
|
- printf("Geometry shader error:\n%s", error);
|
|
|
+ glGetShaderInfoLog(GeometryShaderObject, sizeof(error), 0, error); logPrint("Geometry shader error:\n%s", error);
|
|
|
glDeleteShader(GeometryShaderObject); free(UseContent);
|
|
|
return -1;
|
|
|
+ } else {
|
|
|
+ glGetShaderInfoLog(GeometryShaderObject, sizeof(error), 0, error); if(error[0]) logPrint("Geometry shader info:\n%s", error);
|
|
|
}
|
|
|
free(UseContent);
|
|
|
|
|
@@ -1466,7 +1469,7 @@ void tnsQuit(){
|
|
|
void tnsRestoreFromNanoVG(){
|
|
|
glBindVertexArray(T->CurrentVAO);
|
|
|
tnsUseImmShader(); tnsEnableShaderv(T->immShader);
|
|
|
- glActiveTexture(GL_TEXTURE0);
|
|
|
+ glActiveTexture(GL_TEXTURE0); tnsActiveTexture(GL_TEXTURE0);
|
|
|
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
|
|
|
}
|
|
|
|
|
@@ -1770,8 +1773,9 @@ void tnsConfigure2DTexture(tnsTexture *t){
|
|
|
int format=isDepth?GL_DEPTH_COMPONENT:(t->GLTexBitsType==GL_R8?GL_RED:(t->GLTexBitsType==GL_RG8?GL_RG:(t->GLTexBitsType==GL_RGB8?GL_RGB:GL_RGBA)));
|
|
|
int type=isDepth?GL_UNSIGNED_INT:GL_UNSIGNED_BYTE;
|
|
|
if(t->GLTexBitsType==GL_RGBA16UI){ format=GL_RGBA_INTEGER; type=GL_UNSIGNED_SHORT; t->IsUIntTexture=1; }
|
|
|
- if(t->GLTexBitsType==GL_RGBA16F){ format=GL_RGBA; type=GL_FLOAT; }
|
|
|
+ if(t->GLTexBitsType==GL_RGBA32UI){ format=GL_RGBA_INTEGER; type=GL_UNSIGNED_INT; t->IsUIntTexture=1; }
|
|
|
if(t->GLTexBitsType==GL_R32UI){ format=GL_RED_INTEGER; type=GL_UNSIGNED_INT; t->IsUIntTexture=1; }
|
|
|
+ if(t->GLTexBitsType==GL_RGBA16F){ format=GL_RGBA; type=GL_FLOAT; }
|
|
|
if(t->GLTexBitsType==GL_DEPTH_STENCIL){ format=GL_DEPTH_STENCIL; type=GL_UNSIGNED_INT_24_8; t->GLTexBitsType=GL_DEPTH24_STENCIL8; }
|
|
|
#ifndef LAGUI_ANDROID
|
|
|
if(isDepth){t->GLTexBitsType=GL_DEPTH_COMPONENT24; type=GL_UNSIGNED_INT;}
|
|
@@ -1782,10 +1786,12 @@ void tnsConfigure2DTexture(tnsTexture *t){
|
|
|
glTexStorage2D(GL_TEXTURE_2D, 1,t->GLTexBitsType,t->Width, t->Height);
|
|
|
}
|
|
|
int a=glGetError();
|
|
|
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
|
|
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
|
|
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
|
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
|
+ int clamp = GL_CLAMP_TO_EDGE;
|
|
|
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp);
|
|
|
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp);
|
|
|
+ int filter = GL_LINEAR; if (t->IsUIntTexture) { filter = GL_NEAREST; }
|
|
|
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
|
|
|
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
|
|
|
//glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
|
|
}
|
|
|
}
|