Skip to content

Commit

Permalink
ref_gl: fix enabling multitexturing on GLES
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Toroshchin committed Oct 5, 2023
1 parent ca218a5 commit 9c6da09
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ref/gl/gl2_shim/fragment.glsl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ R"(
#define in varying
#define texture texture2D
#endif
#if version >= 130
#if VER >= 130
precision mediump float;
#endif
#if ATTR_TEXCOORD0
Expand Down
2 changes: 1 addition & 1 deletion ref/gl/gl2_shim/gl2_shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static GLuint GL2_GenerateShader( gl2wrap_prog_t *prog, GLenum type )
int i;
GLint status, len;
GLuint id, loc;
int version = 130;
int version = 300;

shader = shader_buf;
//shader[0] = '\n';
Expand Down
5 changes: 4 additions & 1 deletion ref/gl/gl_opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,12 @@ void GL_InitExtensionsGLES( void )
GL_CheckExtension( "vertex_buffer_object", vbofuncs, "gl_vertex_buffer_object", extid );
break;
case GL_ARB_MULTITEXTURE:
GL_SetExtension( extid, true ); // required to be supported by wrapper
GL_CheckExtension( "multitexture", multitexturefuncs, "gl_arb_multitexture", GL_ARB_MULTITEXTURE );
//GL_SetExtension( extid, true ); // required to be supported by wrapper

pglGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB, &glConfig.max_texture_units );
if( glConfig.max_texture_units <= 1 )
pglGetIntegerv( GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &glConfig.max_texture_units );
if( glConfig.max_texture_units <= 1 )
{
GL_SetExtension( extid, false );
Expand Down

0 comments on commit 9c6da09

Please sign in to comment.