View Single Post
Old 04-04-03, 03:42 PM   #9
grmoc
.. Arg!!. Uh Pinky?
 
Join Date: Jan 2003
Posts: 38
Default

Allrighty, this is in uniprocessor mode, with a different application triggering the bug. Screenshot attached.

Use the following code to duplicate the problem (which seems only to manifest when applications use GL... at least thusfar..)

//
// Command line to compile me:
//
// g++ test.cpp -lGL -lGLU -L/usr/X11R6/lib -lX11

#include <iostream>

using namespace std;

#ifdef DEBUG
# define ONDEBUG(X) X
#else
# define ONDEBUG(X)
#endif


#include <X11/Xlib.h>
#include <X11/keysym.h>
#include "GL/gl.h"
#include "GL/glx.h"
#include "GL/glu.h"

int main(int argc, char** argv){
Display *_dpy=0;
GLXFBConfig* _configs=0;
GLXContext *_ctx=0;

GLXPbuffer _pbuffer;

char *dpyName = 0;

_dpy = XOpenDisplay(dpyName);
if (!_dpy) {
std::cerr<<"Error: couldn't open display ";
if(dpyName) std::cerr<<dpyName;
std::cerr<<"\n";
exit(0);
}

int i;

int nItems=0;
int fbAttribList[]={
GLX_RED_SIZE,8,
GLX_GREEN_SIZE,8,
GLX_BLUE_SIZE,8,
GLX_ALPHA_SIZE,8,
GLX_STENCIL_SIZE,8,
GLX_DEPTH_SIZE,24,
GLX_ACCUM_RED_SIZE,16,
GLX_ACCUM_GREEN_SIZE,16,
GLX_ACCUM_BLUE_SIZE,16,
GLX_ACCUM_ALPHA_SIZE,16,
GLX_RENDER_TYPE,GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE,GLX_PBUFFER,
GLX_CONFIG_CAVEAT,GLX_NONE,
None
};


_configs=glXChooseFBConfig(_dpy,DefaultScreen(_dpy ),
fbAttribList,&nItems);

//GLXFBConfig* configs=glXGetFBConfigs(dpy,DefaultScreen(dpy),&nI tems);
ONDEBUG(std::cerr<<nItems<<" GLXFBConfigs returned.\n"

if(_configs==0){
std::cerr<<"error: "<< gluErrorString(glGetError()) <<"\n";
std::cerr<<"dpy==" <<(void*)_dpy<<" screen="<<DefaultScreen(_dpy)<<"\n";
std::cerr<<"configs="<< (void*)_configs<<"\n";
std::cerr<<"Wasn't able to choose a valid FBConfig. Exiting.\n";
exit(0);
}

int pbAttribList[] = {
GLX_PBUFFER_WIDTH,720,
GLX_PBUFFER_HEIGHT,486,
None
};

_pbuffer=glXCreatePbuffer(_dpy,_configs[0],pbAttribList);
ONDEBUG(std::cerr<<"Here is the pbuffer!! ("<<_pbuffer <<")\n"


_ctx = new GLXContext;
*_ctx=glXCreateNewContext(_dpy,_configs[0],GLX_RGBA_TYPE,0,True );

ONDEBUG(std::cerr<<"Here is the ctx!" <<_ctx<< "\n"
if(glXMakeCurrent(_dpy,_pbuffer,*_ctx)){
ONDEBUG(std::cerr<<"Binding of new glx context (to pbuffer) is successful\n"
}else{
std::cerr<<"Doh! Binding of new glx context (to pbuffer) is NOT successful\n";
std::cerr<<"Gl says: \"" << gluErrorString(glGetError()) <<"\"\n";
}

std::cerr<<"GL_RENDERER = "<< glGetString(GL_RENDERER) <<"\n";
std::cerr<<"GL_VERSION = "<< glGetString(GL_VERSION) <<"\n";
std::cerr<<"GL_VENDOR = "<< glGetString(GL_VENDOR) <<"\n";
std::cerr<<"GL_EXTENSIONS = "<< glGetString(GL_EXTENSIONS) <<"\n";

glViewport(0,0,720,486);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,720,0,486,-10000,10000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();


unsigned char frameBuf[720][486][4];
i=0;
while(1){
glReadPixels(0,0,720,486,GL_RGBA,GL_UNSIGNED_BYTE, (unsigned char*) frameBuf);
cerr<<"\rThis is a string of indeterminate length. I love big words "<<++i<<" iterations";
}
return 1;
}
Attached Thumbnails
Click image for larger version

Name:	ewww3.png
Views:	153
Size:	48.5 KB
ID:	1182  
grmoc is offline   Reply With Quote