Sign in to follow this  
FILO

OpenGL OpenGL book reccomendation

Recommended Posts

FILO    122
Hi All, I am considering getting OpenGL Programming for the X Window System but the reviews on amazon and the date it was published seem to indicate that this book is a little out of date. Is this the case and or does anyone have any more current suggestions for linux/OpenGL programming books? Thanks. -H

Share this post


Link to post
Share on other sites
Ademan555    361
Well OpenGL is cross platform, the only thing you might need to learn that is platform specific is the 'glx' family of functions, aside from them you can pick any OpenGL book, I recommend "OpenGL Game Programming" by Dave Astle, it's considered to be the gold standard around here.

I develop on linux actually, and I have NEVER touched glx myself(though I've looked it over), I just let SDL handle it for me, that's the method I personally endorse :-), but again, everything else will be cross platform (and the everything else part is far more important for creating fun and exciting games). Learn OpenGL, use either SDL (my vote), GLut, or glfw to handle initilialization, if you ever feel in the future that you (for whatever reason...) need to use glx directly (trust me, you don't need to, and you don't want to) you can just learn that family of functions.

Share this post


Link to post
Share on other sites
FILO    122
Quote:
Original post by Ademan555
Well OpenGL is cross platform, the only thing you might need to learn that is platform specific is the 'glx' family of functions, aside from them you can pick any OpenGL book, I recommend "OpenGL Game Programming" by Dave Astle, it's considered to be the gold standard around here.

I develop on linux actually, and I have NEVER touched glx myself(though I've looked it over), I just let SDL handle it for me, that's the method I personally endorse :-), but again, everything else will be cross platform (and the everything else part is far more important for creating fun and exciting games). Learn OpenGL, use either SDL (my vote), GLut, or glfw to handle initilialization, if you ever feel in the future that you (for whatever reason...) need to use glx directly (trust me, you don't need to, and you don't want to) you can just learn that family of functions.


Thanks for all the help guys. I currently own the red book and the blue book both of which are totally amazing books.

I was using SDL but unfortunately a feature I need (outputting opengl in full screen mode from a application across multiple monitors) is only tentatively supported in the very latest version which you need to grab/compile you're self from subversion (1.3).

At the moment I have managed to get dual head OpenGL going with xlib and glx. Xlib is pretty tricky and unintuitive to work with and trying to find out how to do something specific with the docs/examples is a bit of a nightmare. I eventually gave up reading articles and just looked at the source for xterm and pieced things together from that. Hence my feeling that I need a book on working with glx/xlib.

The main reason I don't want to play with sdl 1.3 is:

http://www.gamedev.net/community/forums/topic.asp?topic_id=380142


"SDL 1.3 is the experimental branch of SDL, where we will be breaking
binary compatibility and upgrading the API to fix a few shortcomings and
support new functionality. At one point SDL 1.3 had experimental render
to texture support, but it wasn't possible to maintain the same GL context
semantics on each platform, and it has been phased out in favor of the
OpenGL vertex buffer object extension. The original render to texture
code is in bugzilla as a patch relative to 1.3, for historical interest."

My ideal solution would be something that does dual screen and is cross platform has a decent timer and can handle very basic input.


My current bet is that writing my own wrapper for OSX/LINUX/Windows will probably be less work and easier to debug than dealing with the random stuff thats bound to come up with SDL 1.3. Any comments on this strategy? Anyone care to suggest another library?

Share this post


Link to post
Share on other sites
Ademan555    361
Ah, I see, you already knew what you were talking about then :-D.

Anyways, I don't really know what the best way to go about things is. I think you're *probably* right that you've got the best way to go about things (unfortunately). I'm not entirely sure if it's possible to setup "true" dual head support with glx without Xinerama, but I'm not very well versed in Xlib so I'll shutup now :-p.

I didn't really provide any useful information, but I'm going to post anyways, just in case me tossing around the name Xinerama actually turns out to be relevant information lol.

Share this post


Link to post
Share on other sites
FILO    122
Thanks guys, its great to get feedback and I really appreciate the sanity (or in the case of xlib insanity ;P ) check .

How I manged to get dual screen going with xlib/glx, was to use grandr under debian to create a 2048X768 virtual screen from my 2 1024x768 lcds. I then created two windows each with their own opengl context (dimensions of each being set to 1024 x 768). I then told x to move one window to 1024 using the xmove macro and then sent a full screen event/message to that window. I then created the other window at 0,0 and told it to fullscreen using the same technique. This seems to work and I can get opengl graphics going across both screns. I am not sure if this is the correct or even a nice way to do things but it's the only way I have found so far. Any suggestions or xlib code snippits would be most appreciated. I am planning on looking at how http://www.pyglet.org/ handles multiple screens cross platform to see if their is a better way to interface/do this with xlib.

Right now everything works fine provided I don't try to pole for events within my main loop. My problem is that trying to capture events using xlib and the next event function causes my application to only update when I move a mouse or press a key. Now I am guessing that this has something to do with the way the callback function for events works in xlib.

I have yet to figure out how glx informs x whenever it swap a buffer. One solution I am considering is creating an expose event (event triggered when one window moves over another in x) every time I need to swap a buffer. Now I don't think an event should be triggered every time a buffer is swapped and I don't think I need to add threads to my application just to pole for a few key presses. Hence I think I am doing something wrong and I should go read a good book or something.

So I guess a question would be, has anyone written any opengl applications which polled for events using glx/xlib. I am currently using the XNextEvent to check for key presses. Also could I use some other library/technique to check for inputs on linux?

Share this post


Link to post
Share on other sites
FILO    122
Quote:
Original post by MARS_999
The latest "OpenGL SuperBible" 3rd edition I think, is a great book, it covers Linux, Win32, OSX



Yeah I have that (the blue book), I started from the example in chapter 21 and modified it to work across 2 screens. Its a brilliant book but the chapter on linux is like 20 pages long and parts of that deal with glut. The main focus on the chapter is GLX; it gives you everything you need to setup a window that displays opengl which reacts to a mouse moving around. It doesn't really cover much of how xlib handles events (this is not really a flaw of the book just a reflection of how complicated xlib is). I am trying to have animated sprites moving on the screen and have xlib poll for events. The example in the book is a set of eyes that point where ever you move the mouse. The eyes only move when the mouse does.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By pseudomarvin
      I assumed that if a shader is computationally expensive then the execution is just slower. But running the following GLSL FS instead just crashes
      void main() { float x = 0; float y = 0; int sum = 0; for (float x = 0; x < 10; x += 0.00005) { for (float y = 0; y < 10; y += 0.00005) { sum++; } } fragColor = vec4(1, 1, 1 , 1.0); } with unhandled exception in nvoglv32.dll. Are there any hard limits on the number of steps/time that a shader can take before it is shut down? I was thinking about implementing some time intensive computation in shaders where it would take on the order of seconds to compute a frame, is that possible? Thanks.
    • By Arulbabu Donbosco
      There are studios selling applications which is just copying any 3Dgraphic content and regenerating into another new window. especially for CAVE Virtual reality experience. so that the user opens REvite or CAD or any other 3D applications and opens a model. then when the user selects the rendered window the VR application copies the 3D model information from the OpenGL window. 
      I got the clue that the VR application replaces the windows opengl32.dll file. how this is possible ... how can we copy the 3d content from the current OpenGL window.
      anyone, please help me .. how to go further... to create an application like VR CAVE. 
       
      Thanks
    • By cebugdev
      hi all,

      i am trying to build an OpenGL 2D GUI system, (yeah yeah, i know i should not be re inventing the wheel, but this is for educational and some other purpose only),
      i have built GUI system before using 2D systems such as that of HTML/JS canvas, but in 2D system, i can directly match a mouse coordinates to the actual graphic coordinates with additional computation for screen size/ratio/scale ofcourse.
      now i want to port it to OpenGL, i know that to render a 2D object in OpenGL we specify coordiantes in Clip space or use the orthographic projection, now heres what i need help about.
      1. what is the right way of rendering the GUI? is it thru drawing in clip space or switching to ortho projection?
      2. from screen coordinates (top left is 0,0 nd bottom right is width height), how can i map the mouse coordinates to OpenGL 2D so that mouse events such as button click works? In consideration ofcourse to the current screen/size dimension.
      3. when let say if the screen size/dimension is different, how to handle this? in my previous javascript 2D engine using canvas, i just have my working coordinates and then just perform the bitblk or copying my working canvas to screen canvas and scale the mouse coordinates from there, in OpenGL how to work on a multiple screen sizes (more like an OpenGL ES question).
      lastly, if you guys know any books, resources, links or tutorials that handle or discuss this, i found one with marekknows opengl game engine website but its not free,
      Just let me know. Did not have any luck finding resource in google for writing our own OpenGL GUI framework.
      IF there are no any available online, just let me know, what things do i need to look into for OpenGL and i will study them one by one to make it work.
      thank you, and looking forward to positive replies.
    • By fllwr0491
      I have a few beginner questions about tesselation that I really have no clue.
      The opengl wiki doesn't seem to talk anything about the details.
       
      What is the relationship between TCS layout out and TES layout in?
      How does the tesselator know how control points are organized?
          e.g. If TES input requests triangles, but TCS can output N vertices.
             What happens in this case?
      In this article,
      http://www.informit.com/articles/article.aspx?p=2120983
      the isoline example TCS out=4, but TES in=isoline.
      And gl_TessCoord is only a single one.
      So which ones are the control points?
      How are tesselator building primitives?
    • By Orella
      I've been developing a 2D Engine using SFML + ImGui.
      Here you can see an image
      The editor is rendered using ImGui and the scene window is a sf::RenderTexture where I draw the GameObjects and then is converted to ImGui::Image to render it in the editor.
      Now I need to create a 3D Engine during this year in my Bachelor Degree but using SDL2 + ImGui and I want to recreate what I did with the 2D Engine. 
      I've managed to render the editor like I did in the 2D Engine using this example that comes with ImGui. 
      3D Editor preview
      But I don't know how to create an equivalent of sf::RenderTexture in SDL2, so I can draw the 3D scene there and convert it to ImGui::Image to show it in the editor.
      If you can provide code will be better. And if you want me to provide any specific code tell me.
      Thanks!
  • Popular Now