ev1313 / Pascal-SDL-2-Headers

These are the Pascal SDL 2 Headers.
Mozilla Public License 2.0
113 stars 48 forks source link

What OpenGL headers to use? #33

Closed basisbit closed 8 years ago

basisbit commented 8 years ago

what OpenGL headers do you suggest to use in combination with these Pascal-SDL-2-Headers? I am currently using an own heavily modified version of the jedi-sdl headers but they only sorta work with up to OpenGL 2 stuff. I also tried dglOpenGL headers but they use different types in many places so I was not able to hand over the opengl context from SDL_GL_CreateContext to be used by the dglOpenGL code.

Free-Pascal-meets-SDL-Website commented 8 years ago

I'm not sure if the issue area is the right place to discuss these kind of questions.

As a hint, you may be interested in this article http://www.freepascal-meets-sdl.net/chapter-10-sdl-modern-opengl/ though.

Am 10.05.2016 um 22:38 schrieb basisbit:

what OpenGL headers do you suggest to use in combination with these Pascal-SDL-2-Headers? I am currently using an own heavily modified version of the jedi-sdl headers but they only sorta work with up to OpenGL 2 stuff. I also tried dglOpenGL headers but they use different types in many places so I was not able to hand over the opengl context from SDL_GL_CreateContext to be used by the dglOpenGL code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/ev1313/Pascal-SDL-2-Headers/issues/33

basisbit commented 8 years ago

sorry, but that blog post is not really helpfull. to me it looks like you are using the compilers gl and glext units instead of the dglOpenGL and you only use stuff already available in the OpenGL 2 headers. I am the developer of https://github.com/UltraStar-Deluxe/USDX and also recently switched to the Pascal-SDL-2-Headers. I wasn't able to get rid of the old jedi-sdl-opengl implementation (which is provided by freepascal compiler) and at the same time still use any glext or glu functions. In my opinion this issue here in the project issue-tracker is the correct place to discuss about how to solve the problem that freepascal and Pascal-SDL-2-Headers are missing usable and somewhat current OpenGL headers.

ev1313 commented 8 years ago

I recommend dglOpenGL.pas, I used something like this (years ago):

https://github.com/ev1313/EVEngine/blob/master/evmain.pas#L662

Especially these lines are after SDL_GL_CreateContext important: InitOpenGL; ReadExtensions; ReadImplementationProperties;

Free-Pascal-meets-SDL-Website commented 8 years ago

I'm sorry if the article wasn't helpful. Seems I missed your point.

To me it is more like a general problem if Free Pascal is missing usable (stand-alone) OpenGL headers. At first sight, this is not necessarily related to SDL (therefore my remark about the place). I can now see your point of view though. :-)

I'd appreciate to see if you can get dglOpenGL.pas get to work within your project. Good luck.

basisbit commented 8 years ago

in case someone else is searching for example code on how to get this working, feel free to take a look at https://github.com/UltraStar-Deluxe/USDX/blob/40076776ac5afca05bae90d6b4299f43c4923593/src/base/UGraphic.pas#L597