[fpc-pascal] OpenGL and SDL frustrations
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Wed May 24 14:18:42 CEST 2017
On 2017-05-24 04:13, Ryan Joseph wrote:
> Any ideas on what’s wrong with this?
I actually used the Java + OpenGL tutorials on YouTube, and translating
those examples to Object Pascal + OpenGL + SDL2 was pretty easy.
This is my favourite one, and uses "modern OpenGL" only.
https://www.youtube.com/watch?v=VS8wlS9hF8E&list=PLRIWtICgwaX0u7Rf9zkZhLoLuZVfUksDP
"OpenGL 3D Game Tutorial" by ThinMatrix.
I also wanted something reusable, so I implemented classes in separate
units that I can reuse between projects. Instead of 100's of loosely
scattered OpenGL API calls. I was actually going to contribute all this
work as part of my Lazarus Graphics Programming Contest entry, but I
might just release it earlier than that.
Anyway, attached is one such unit setting up my display. I use
proprietary NVIDIA drivers under FreeBSD, and I only target OpenGL 4.x
with my code. It works perfectly here.
My program code is pretty much like this:
TDisplayManager.CreateDisplay;
while running do
begin
// do the "gaming loop" here
TDisplayManager.UpdateDisplay;
end;
// clean-up code here
TDisplayManager.CloseDisplay;
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: displaymanager.pas
Type: text/x-pascal
Size: 1909 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170524/1439f354/attachment.pas>
More information about the fpc-pascal
mailing list