Skip to content

Commit

Permalink
Cleanup & LIB_MINVER
Browse files Browse the repository at this point in the history
now  use LIB_MINVER
  • Loading branch information
BeWorld2018 committed Sep 28, 2024
1 parent 7bc8cad commit 440045f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
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 @@ -61,9 +61,7 @@ static CONSTRUCTOR_P(init_SDL2Base, 100)

if (base)
{
UWORD version = base->lib_Version;
UWORD revision = base->lib_Revision;
if (version < VERSION || (version == VERSION && revision < REVISION))
if (!LIB_MINVER(base, VERSION, REVISION))
{
CloseLibrary(base);
base = NULL;
Expand Down
9 changes: 1 addition & 8 deletions src/video/morphos/SDL_mosopengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,8 @@ MOS_GL_LoadLibrary(_THIS, const char *path)
TinyGLBase = OpenLibrary("tinygl.library", 53);

if (TinyGLBase) {
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 < 8))
if (!LIB_MINVER(TinyGLBase, 53, 8))
{
// tingl < 53.8
SDL_SetError("Failed to open tinygl.library 53.8+");
return -1;
}
Expand Down Expand Up @@ -173,7 +169,6 @@ SDL_bool MOS_GL_InitContext(_THIS, SDL_Window * window)
int success = GLAInitializeContext(__tglContext, tgltags);
if (success) {
data->__tglContext = __tglContext;
//tglEnableNewExtensions(0); // Active TinyGL New extensions
}

return success ? SDL_TRUE : SDL_FALSE;
Expand All @@ -188,11 +183,9 @@ MOS_GL_CreateContext(_THIS, SDL_Window * window)
if (glcont) {
__tglContext = glcont;
#ifdef TGL_CONTEXT_VERSION_53_9
#warning TGL_CONTEXT_VERSION_53_9
if (SDL2Base->MyGetMaximumContextVersion)
{
unsigned int contextversion;

contextversion = SDL2Base->MyGetMaximumContextVersion(TinyGLBase);

if (contextversion == TGL_CONTEXT_VERSION_53_1)
Expand Down

0 comments on commit 440045f

Please sign in to comment.