I think all it's missing is a simple 'comfort' layer with some general Setup(), Load/CatchTexture() & Render() routines built-in to the library, as people new to graphics programming who load sample #1 may be put off with the 200+ lines of code used to demonstrate a textured cube.
SGL (Simple GL)
Re: SGL (Simple GL)
This is a spectacularly well written library & clearly a lot of time and effort has gone into it - thanks for sharing it with us Luis.
I think all it's missing is a simple 'comfort' layer with some general Setup(), Load/CatchTexture() & Render() routines built-in to the library, as people new to graphics programming who load sample #1 may be put off with the 200+ lines of code used to demonstrate a textured cube.
I think all it's missing is a simple 'comfort' layer with some general Setup(), Load/CatchTexture() & Render() routines built-in to the library, as people new to graphics programming who load sample #1 may be put off with the 200+ lines of code used to demonstrate a textured cube.
Re: SGL (Simple GL)
Hi pjay, thank you,
I know the examples require still a lot of setup code, even if less compared to naked OpenGL, but this library is to simplify OpenGL programming, nothing more.
My intention was to make a sort of GLFW but easily usable in PB (offering keyboard and mouse input, windowing, etc) while adding something more to the base GLFW (easier debugging, shaders loading/execution/error handling, facilitate texture loading, facilitate implementation of font rendering, some system info) without going overboard.
It does all that, but it's directed to OpenGL programmers or people learning OpenGL, so some things have no place inside this lib. As I said I consider SGL probably finished here.
I know the examples require still a lot of setup code, even if less compared to naked OpenGL, but this library is to simplify OpenGL programming, nothing more.
My intention was to make a sort of GLFW but easily usable in PB (offering keyboard and mouse input, windowing, etc) while adding something more to the base GLFW (easier debugging, shaders loading/execution/error handling, facilitate texture loading, facilitate implementation of font rendering, some system info) without going overboard.
It does all that, but it's directed to OpenGL programmers or people learning OpenGL, so some things have no place inside this lib. As I said I consider SGL probably finished here.
"Have you tried turning it off and on again ?"
- skinkairewalker
- Enthusiast

- Posts: 799
- Joined: Fri Dec 04, 2015 9:26 pm
Re: SGL (Simple GL)
Wouldn't it be possible to use your imgui module with the current ogre3d in purebasic?
- StarBootics
- Addict

- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: SGL (Simple GL)
Probably not, simply because the luis's module uses a BatchRenderer to render the GUI. As far as I know the Ogre implementation used in PureBasic don't have that.skinkairewalker wrote: Sat Jan 06, 2024 10:55 pm Wouldn't it be possible to use your imgui module with the current ogre3d in purebasic?
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: SGL (Simple GL)
Maybe you forgot but you asked the same thing in Julyskinkairewalker wrote: Sat Jan 06, 2024 10:55 pm Wouldn't it be possible to use your imgui module with the current ogre3d in purebasic?
I paste my previous answer because nothing is changed
But again, I can't stress it enough: it's not a finished product... a library.It's just a demo of how it's possible to implement a IMGUI in OpenGL, it's not remotely complete or really usable for something serious.
That being said, when Ogre is set to use OpenGL I suppose it could be possible to make this work, but certainly not without some modifications and frankly does not sound like a good idea to me.
If I needed something like this for "PB Ogre" I would just follow the same principles shown in this demo and implement it using the PB Ogre command set.
It's just a demo implemented using this library (SGL) to test a concept and test the library itself.
The good thing is you have the source.
Also as StarBootics mentioned, the module uses a batch renderer (another demo for the SGL library) and this would not fit easily with using PB Ogre at the same time. You can use the same concepts outlined in the module to handle the "gadgets" and to decide when to draw and what, that part should stay the same but the batch renderer input data should be translated to PB Ogre drawing commands.
I'm not familiar with it, so I can't help.
And if there is not a concept for buffering drawing calls in it, it would end up being probably slower... but I simply don't know.
"Have you tried turning it off and on again ?"
- skinkairewalker
- Enthusiast

- Posts: 799
- Joined: Fri Dec 04, 2015 9:26 pm
Re: SGL (Simple GL)
happy New Year to everybody,
So the problem with purebasic not supporting modules like this is because it currently doesn't support opengl?
With the new implementation of Purebasic 6.10, perhaps it is not possible to use the Cimgui library to embed it in directx 9 or something along those lines?
Sorry, I had forgotten... xDluis wrote: Sat Jan 06, 2024 11:44 pm Maybe you forgot but you asked the same thing in July
I paste my previous answer because nothing is changed
So the problem with purebasic not supporting modules like this is because it currently doesn't support opengl?
With the new implementation of Purebasic 6.10, perhaps it is not possible to use the Cimgui library to embed it in directx 9 or something along those lines?
- StarBootics
- Addict

- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: SGL (Simple GL)
No, a BatchRenderer need to be integrated into OGRE engine in order to work. As far as I know the OGRE implementation used in PureBasic don't support that.skinkairewalker wrote: Mon Jan 22, 2024 5:07 am So the problem with purebasic not supporting modules like this is because it currently doesn't support opengl?
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
-
jamirokwai
- Enthusiast

- Posts: 798
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: SGL (Simple GL)
Hi Luis,
looks great! I'd be interested to work with this library
Do you think, a MacOS-version would be a lot of work?
looks great! I'd be interested to work with this library
Do you think, a MacOS-version would be a lot of work?
Regards,
JamiroKwai
JamiroKwai
Re: SGL (Simple GL)
Hi, it wouldn't be a lot of work, you need to compile GLFW for macOS (wasn't OS X just a while ago ? they can't stick to a name) and update the glfw importer (contained in SGL).
Plus, you need to double check the functions in SGL dealing with system stuff to see if you need to change something there (probably very little if anything).
But I will not be the one doing it because I don't have a Mac and I don't particularly like to work or even use a Mac, sorry!
If someone wants to do it is more than welcome to fork it on github and if he has any questions about the code I'm here.
"Have you tried turning it off and on again ?"
-
jamirokwai
- Enthusiast

- Posts: 798
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: SGL (Simple GL)
Hi Luis,luis wrote: Mon Jan 22, 2024 4:36 pmHi, it wouldn't be a lot of work, you need to compile GLFW for macOS (wasn't OS X just a while ago ? they can't stick to a name) and update the glfw importer (contained in SGL).
Plus, you need to double check the functions in SGL dealing with system stuff to see if you need to change something there (probably very little if anything).
But I will not be the one doing it because I don't have a Mac and I don't particularly like to work or even use a Mac, sorry!
If someone wants to do it is more than welcome to fork it on github and if he has any questions about the code I'm here.
great, thanks for the hints. I will have a look during the week.
There IS a compiled lib for macOS (OS X, macOS X, whatever), so I will start there.
Cheers
Regards,
JamiroKwai
JamiroKwai
- skinkairewalker
- Enthusiast

- Posts: 799
- Joined: Fri Dec 04, 2015 9:26 pm
Re: SGL (Simple GL)
using pb6.20 ogre it becomes compatible with your IMGUI module made in SGL?
Re: SGL (Simple GL)
Hi, I have no real idea but I imagine the answer is still probably no.
My example (again it's not a remotely usable gui, it's an example of a possibile way of building a IMGUI in OpenGL) needs a batch renderer and unless the PB interface to OGRE support batch rendering and gives you new PB commands to work with it you can't even really re-implement it in PB to use OGRE.
Even less to use my code as it is.
My example (again it's not a remotely usable gui, it's an example of a possibile way of building a IMGUI in OpenGL) needs a batch renderer and unless the PB interface to OGRE support batch rendering and gives you new PB commands to work with it you can't even really re-implement it in PB to use OGRE.
Even less to use my code as it is.
"Have you tried turning it off and on again ?"
- skinkairewalker
- Enthusiast

- Posts: 799
- Joined: Fri Dec 04, 2015 9:26 pm
Re: SGL (Simple GL)
hi, how u doing luis?
I recently saw that MPZ is recreating its engine directly for opengl in pb, as per the link below :
https://github.com/MPzCodes/MP3D_Opengl
Is there any way to make SGL (Simple GL) compatible with MP3D? or are both completely different opengl versions?
I recently saw that MPZ is recreating its engine directly for opengl in pb, as per the link below :
https://github.com/MPzCodes/MP3D_Opengl
Is there any way to make SGL (Simple GL) compatible with MP3D? or are both completely different opengl versions?
Re: SGL (Simple GL)
Hi, all well thank you, just busy doing other things.
I think it's always difficult to mix and match different OpenGL code, most of the code depends on how the context has been setup. MP3D OpenGL (from a cursory look) uses OpenglGadget, so the context provided by PureBasic (a compatible context, a sort of catch all if you like). My library uses what you want, you can setup the context as you like, and some of the examples use a legacy context while other a modern context.
Your best bet if there is something you want to use to use from SGL in MP3D is to just look how it works in SGL and rewrite it MP3D. Some changes are inevitable.
But I don't think it's worth it. This is just a learning tool or a starting point to build your stuff (even an engine) on top of it.
I think it's always difficult to mix and match different OpenGL code, most of the code depends on how the context has been setup. MP3D OpenGL (from a cursory look) uses OpenglGadget, so the context provided by PureBasic (a compatible context, a sort of catch all if you like). My library uses what you want, you can setup the context as you like, and some of the examples use a legacy context while other a modern context.
Your best bet if there is something you want to use to use from SGL in MP3D is to just look how it works in SGL and rewrite it MP3D. Some changes are inevitable.
But I don't think it's worth it. This is just a learning tool or a starting point to build your stuff (even an engine) on top of it.
"Have you tried turning it off and on again ?"
- skinkairewalker
- Enthusiast

- Posts: 799
- Joined: Fri Dec 04, 2015 9:26 pm
Re: SGL (Simple GL)
Thank you for your response and sharing your experience with me.luis wrote: Fri Feb 14, 2025 9:10 pm Hi, all well thank you, just busy doing other things.
I think it's always difficult to mix and match different OpenGL code, most of the code depends on how the context has been setup. MP3D OpenGL (from a cursory look) uses OpenglGadget, so the context provided by PureBasic (a compatible context, a sort of catch all if you like). My library uses what you want, you can setup the context as you like, and some of the examples use a legacy context while other a modern context.
Your best bet if there is something you want to use to use from SGL in MP3D is to just look how it works in SGL and rewrite it MP3D. Some changes are inevitable.
But I don't think it's worth it. This is just a learning tool or a starting point to build your stuff (even an engine) on top of it.