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); |
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[] = { |
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 |
|
|
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) |