Skip to content

Commit

Permalink
MorphOS: update version and code
Browse files Browse the repository at this point in the history
Update version to 53.15
Now you need TinyGL 53.8 or more (14.08.2023)
Now always use tglEnableNewExtensions !
  • Loading branch information
BeWorld2018 committed Apr 3, 2024
1 parent 25f6a7d commit 48b4c4e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion sdl2-config
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ while test $# -gt 0; do
echo $exec_prefix
;;
--version)
echo 2.30.1
echo 2.30.2
;;
--cflags)
echo -noixemul -I${prefix}/include/SDL2
Expand Down
2 changes: 1 addition & 1 deletion src/core/morphos/SDL_mosversion.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define str(s) #s
#define xstr(s) str(s)
#define VERSION 53
#define REVISION 14
#define REVISION 15
#define VERSTAG "\0$VER: sdl2.library " xstr(VERSION) "." xstr(REVISION) " (" __AMIGADATE__ ") © Bruno Peloille, Szilárd Biró, Ilkka Lehtoranta"
4 changes: 1 addition & 3 deletions src/core/morphos/devenv/sdl-startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ static DESTRUCTOR_P(cleanup_SDL2Base, 100)
{
if (NewLock)
{
CurrentDir(OldLock);
UnLock(NewLock);
//UnLock(CurrentDir(OldLock));
UnLock(CurrentDir(OldLock));
}
CloseLibrary(base);
base = NULL;
Expand Down
6 changes: 3 additions & 3 deletions src/render/opengl/SDL_render_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ static SDL_Renderer *GL_CreateRenderer(SDL_Window *window, Uint32 flags)
data->shaders = GL_CreateShaderContext();
}

//D("OpenGL shaders: %s\n", data->shaders ? "ENABLED" : "DISABLED");
D("OpenGL shaders: %s\n", data->shaders ? "ENABLED" : "DISABLED");

SDL_LogInfo(SDL_LOG_CATEGORY_RENDER, "OpenGL shaders: %s",
data->shaders ? "ENABLED" : "DISABLED");
Expand Down Expand Up @@ -1949,9 +1949,9 @@ static SDL_Renderer *GL_CreateRenderer(SDL_Window *window, Uint32 flags)
SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT");
renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
}
data->framebuffers = NULL;
D("GL_EXT_framebuffer_object: %s\n", data->GL_EXT_framebuffer_object_supported ? "ENABLED" : "DISABLED");

//D("GL_EXT_framebuffer_object: %s\n", data->GL_EXT_framebuffer_object_supported ? "ENABLED" : "DISABLED");
data->framebuffers = NULL;

/* Set up parameters for rendering */
data->glMatrixMode(GL_MODELVIEW);
Expand Down
19 changes: 5 additions & 14 deletions src/video/morphos/SDL_mosopengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ MOS_GL_LoadLibrary(_THIS, const char *path)
UWORD TinyGl_Version = TinyGLBase->lib_Version;
UWORD TinyGl_Revision = TinyGLBase->lib_Revision;
D("[%s] tinygl.library version %d.%d\n", __FUNCTION__, TinyGl_Version, TinyGl_Revision);
if (TinyGl_Version < 53 || (TinyGl_Version == 53 && TinyGl_Revision < 7))
if (TinyGl_Version < 53 || (TinyGl_Version == 53 && TinyGl_Revision < 8))
{
// tingl < 53.7
SDL_SetError("Failed to open tinygl.library 53.7+");
// tingl < 53.8
SDL_SetError("Failed to open tinygl.library 53.8+");
return -1;
}
if (SDL2Base->MyTinyGLBase)
*SDL2Base->MyTinyGLBase = TinyGLBase;

return 0;
} else
SDL_SetError("Failed to open tinygl.library 53.7+");
SDL_SetError("Failed to open tinygl.library 53+");

return -1;
}
Expand Down Expand Up @@ -173,17 +173,8 @@ SDL_bool MOS_GL_InitContext(_THIS, SDL_Window * window)
int success = GLAInitializeContext(__tglContext, tgltags);
if (success) {
data->__tglContext = __tglContext;

SDL_bool withnewextension = SDL_TRUE;

char *val = val = MOS_getenv("SDL_RENDER_OPENGL_SHADERS");
if (val && strlen(val)>0 && strcmp(val, "0")==0)
withnewextension = SDL_FALSE;

if (withnewextension)
tglEnableNewExtensions(0); // Active TinyGL New extensions
tglEnableNewExtensions(0); // Active TinyGL New extensions
}
//D("[%s] success=%d\n", __FUNCTION__, success);

return success ? SDL_TRUE : SDL_FALSE;
}
Expand Down

0 comments on commit 48b4c4e

Please sign in to comment.