Ok, so if using a lazarus for is not a good idea, what would you suggest, as I am on a mac, so I can't do any of the win32 stuff. Also, if I were to use lazarus, how would I go about doing that?
Ok, so if using a lazarus for is not a good idea, what would you suggest, as I am on a mac, so I can't do any of the win32 stuff. Also, if I were to use lazarus, how would I go about doing that?
It is OpenGL 3 ready. Afterall you do the library loading with dglOpenGL functions, not FPC ones.
All i can say is that the executable size may be bigger, over 1mb or something, with added possibility to use LCL components. This means you can have TPanel's and stuff on the form, and it's very useful if you plan to make editor for game that uses OpenGL.
Last edited by User137; 22-03-2013 at 09:07 PM.
How do I load the dglopengl.pas file into my game as there is no .lpk?
you can make your own .lpk and add it to the list
Since it's not including any components or such there is no need for a package. Just add it to your uses clausel and put it in a directory where Lazarus can find (either where your game's sources are located or any of Lazarus' search paths).
sorry, me again - how do I load shaders in fpc? Because in tutorials I see shader = new Shader("shader.vert", "shader.frag");
If you want to study ready source code, i'm happy to show you few weeks ago rewritten shader classes from nxPascal
https://code.google.com/p/nxpascal/s...c/nxGL.pas#177
TShaderSource, TShaderProgram and TGLShader are responsible of creating, loading and using the shader with OpenGL with all imaginative ways possible. Also reporting errors and compile-errors that might come up.
Usage is simple (adding error reporting there's a full demo):
Code:shader:=TGLShader.Create; shader.AddDefault3D(true); shader.Link; shader.Enable;
I don't believe that TLazOpenGLContext is OpenGL 3.x+ compatible, there's special things you need to do at window + context creation time, IE in windows you need to destroy/create a new window after you've checked various capabilities to support multisampling. Also on OSX there's only two ways to get an OpenGL 3.x context, either via a full screen/'windowless' process (CGL) or via opengl 'widgets' in Cocoa. (they annoyingly provide no such functionality for Carbon) So again, you're only going to be having GL3 in a Window on OSX by using cocoa. (and even then you're going to have to deal with the highly buggy GL3.2 implementation that apple decided to grace the world with)
So yeah, don't use TLazOpenGLContext unless you mind loosing multi-sampling, not being fully cross platform for 3.x and having no fine grain control over the garunteed issues you'll have with various hardware/driver/OS combos. You'd be much better off with somthing like Zen, nxPascal, my engine (shameless plug) or anything else that does Window/Context management by itself, sets up multi-sampled windows etc
When the moon hits your eye like a big pizza pie - that's an extinction level impact event.
Well, whatever engine you use it's most likely possible to create the window yourself, as needed per special project.
And all these problems only come into question if you are dealing with Apple's products... of which i'm almost a sworn hater of. Always going their own way, not a trace of backwards compatibility with anything. Draining money from you with all imaginative ways with no shame at all. At least microsoft is doing much better job at keeping old stuff working, and more modular.
Bookmarks