Archived

This topic is now archived and is closed to further replies.

RPTD

opengl and xlib drawing

Recommended Posts

i donno if this one is placed corretly here but it''s linux based so i might get more help here than in the opengl sub forum. i''m currently on a game engine which allows doing windowing. for this purpose i use two kinds of windows: a render window which uses opengl (it''s exchangable, can be dx too, but for linux i need ogl in first place) and works fine and conventional windows where you can draw simple stuff like lines, rectangles and blit bitmaps into it (to allow nifty onscreen windows and stuff). the problem: i can''t render using xlib functions (like XDrawLine) into the backbuffer to draw this window. i always end up in the visible frontbuffer which leads to flickering like hell (sure, it''s over-swapped each frame). anybody knows how i can use common Xlib functions to draw into the backbuffer? i know in DX you can do this but how about OGL and linux? Roland Plüss (The Dragon) =- Turn Imagination Into Reality -=

Share this post


Link to post
Share on other sites
I''d imagine you''d do something like

render to a pixmap using X11
create a OpenGL texture based on the pixmap data
create a quad on the screen, render the texture to it.

Alternatively, you could use GL''s own 2-d rendering stuff. I''m a GL noob, so I''m not sure whether or not oyu can do both at the same time...

Share this post


Link to post
Share on other sites
what exactly are those 2-D drawing capabilites that OGL has? I only noticed once a Rectangle draw function but this is kinda simplistic.
in fact it would appreciate it if i could stay in OGL completly while drawing the 2-D like windows. a turn-around using pixmaps and system memory could be time consuming.

Share this post


Link to post
Share on other sites
Actually, It shouldn''t be much of a turn around.

As for 2d opengl, ask in an openGL forum, somebody will know there

Share this post


Link to post
Share on other sites