Results 1 to 10 of 26

Thread: Which OpenGL Version to use for 2d games

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ok, so I've decided to learn opengl 3+. Noob question time: So I have to install dglOpenGL and what should I use for windowing if I want my game to be cross-platorm? Because glut is old I think.

  2. #2
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    http://www.spacesimulator.net/index.php?p=home
    I don't think we have any multi platform solutions at this time sdl2 would be a good choice if we had working header files. I'm using xlib at the moment. there is enough here to get you started if you speak a little C++

  3. #3
    I'm using Lazarus form and TLazOpenGLContext. It should be perfectly multiplatform. (That with dglOpenGL header, no glut needed for me at least.)

  4. #4
    sorry, me again - how do I load shaders in fpc? Because in tutorials I see shader = new Shader("shader.vert", "shader.frag");

  5. #5
    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;

  6. #6
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    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.

  7. #7
    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.

  8. #8
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    Go Linux, be free

  9. #9
    Quote Originally Posted by Carver413 View Post
    Go Linux, be free
    If only most games would run on linux, it would be an option Last time i tried Ubuntu it had difficulties with simple matter as enabling hardware acceleration for operating system...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •