/[gzz]/gzz/gfx/libos/Os-GLX.cxx
ViewVC logotype

Diff of /gzz/gfx/libos/Os-GLX.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by tjl, Thu Dec 5 08:08:11 2002 UTC revision 1.15 by tjl, Thu Dec 5 08:32:57 2002 UTC
# Line 204  namespace Os { Line 204  namespace Os {
204                          pbufferAttributes, &nel);                          pbufferAttributes, &nel);
205              if(!pbFbConfig) BARF("Can't get dblbuf visual");              if(!pbFbConfig) BARF("Can't get dblbuf visual");
206    
207              pbContext = glXCreateNewContext(dpy, pbFbConfig[0], GLX_RGBA_TYPE,              pbContext = glXCreateNewContext(dpy, pbFbConfig[0],
208                              0, GL_TRUE);                      GLX_RGBA_TYPE,
209                        dbContext, GL_TRUE);
210    
211          }          }
212    
213    
214          Os::Window *openWindow(int x, int y, int w, int h);          Os::Window *openWindow(int x, int y, int w, int h);
215          Os::RenderingSurface *openStableOffScreen(int w, int h) {          Os::RenderingSurface *openStableOffScreen(int w, int h);
             return 0;  
         }  
216    
217          Image *loadImageFile(const char *filename) {          Image *loadImageFile(const char *filename) {
218              ImageRaster r = loadImage(filename);              ImageRaster r = loadImage(filename);
# Line 246  namespace Os { Line 245  namespace Os {
245          LXWindowSystem *ws;          LXWindowSystem *ws;
246    
247          GLXPbuffer pbuf;          GLXPbuffer pbuf;
248            int w, h;
249    
250          LXPBuffer(LXWindowSystem *ws, int w, int h) : ws(ws) {          LXPBuffer(LXWindowSystem *ws, int w, int h) : ws(ws) {
251              int attrs[] = {              int attrs[] = {
# Line 256  namespace Os { Line 256  namespace Os {
256                  0                  0
257              };              };
258              pbuf = glXCreatePbuffer(ws->dpy, ws->pbFbConfig[0], attrs);              pbuf = glXCreatePbuffer(ws->dpy, ws->pbFbConfig[0], attrs);
259    
260                unsigned val;
261                glXQueryDrawable(ws->dpy, pbuf, GLX_PBUFFER_WIDTH, &val);
262                w = val;
263    
264                glXQueryDrawable(ws->dpy, pbuf, GLX_PBUFFER_HEIGHT, &val);
265                h = val;
266            }
267    
268            bool setCurrent() {
269                bool ret = glXMakeContextCurrent(ws->dpy, pbuf, pbuf, ws->pbContext);
270                return ret;
271            }
272            bool releaseCurrent() {
273                bool ret = glXMakeContextCurrent(ws->dpy, None, None, NULL);
274                return ret;
275            }
276    
277            void getSize(int *xywh) {
278                xywh[0] = 0;
279                xywh[1] = 0;
280                xywh[2] = w;
281                xywh[3] = h;
282          }          }
283      };      };
284    
# Line 478  namespace Os { Line 501  namespace Os {
501          return win;          return win;
502      }      }
503    
504        Os::RenderingSurface *LXWindowSystem::openStableOffScreen(int w, int h)
505        {
506            return new LXPBuffer(this, w, h);
507        }
508    
509      WindowSystem *WindowSystem::instance = 0;      WindowSystem *WindowSystem::instance = 0;
510      WindowSystem *WindowSystem::getInstance() {      WindowSystem *WindowSystem::getInstance() {
511          if(!instance)          if(!instance)

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26