Jump to content
  • Advertisement
Sign in to follow this  
greentea8202

X I/O Error

This topic is 5463 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm running FLTK openGL windows to run my viewer. I implemented draw_overlay function that is inherited from Fl_Gl_Window. Then I call redraw_overlay() in mouse_handle function. If I call redraw_overlay() I get Xserver Error as I close the fltk window. The message sometimes is like this: GLXBadContent 0x0 X I/O error or sometimes, the Xserver just crashes, I cannot even see any of the error messages. Does anyone know what could cause this kind of problem?? I'm totally lost.. I'm not sure it's just the graphics card, or some kind of library that I'm missing. btw, I'm running the app on redhat. Thanks!!!! -SJ

Share this post


Link to post
Share on other sites
Advertisement
Hi!

I'm new to Xlib/GLX, but maybe I can help you if you post some of the code that causes the errors and/or your initialization code.

Cheers,
Drag0n

Share this post


Link to post
Share on other sites
Hi,
I'll try to write some pseudo code for part of my applcation since it's too long..


void Viewer::draw_overlay(void)
{
if (m_rubber_on){
glLineWidth(2);
glLineStipple( 3, 0xAAAA );
glEnable( GL_LINE_STIPPLE );
glDisable(GL_DEPTH_TEST);

glLoadIdentity();
glViewport(0,0,m_width, m_height);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D( 0, m_width, m_height, 0 );

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

GLfloat color1[4] = {1.0, 0.0, 0.0, 1.0};
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, color1);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, color1);

glBegin( GL_LINE_LOOP );
glVertex2i( m_start_pos[0], m_start_pos[1]);
glVertex2i( m_end_pos[0], m_start_pos[1]);
glVertex2i( m_end_pos[0], m_end_pos[1]);
glVertex2i( m_start_pos[0], m_end_pos[1]);
glEnd();
}
glEnable(GL_DEPTH_TEST);
}

int Viewer::handle(int event)
{
unsigned long state = Fl::event_state();
int event_b = Fl::event_button();
int x = Fl::event_x();
int y = Fl::event_y();

if (m_mode == COMP_SELECTION){
switch(event){
case FL_PUSH:
if(state & FL_BUTTON1){
m_start_pos[0] = x;
m_start_pos[1] = y;
}
return 1;

case FL_DRAG:
if(state & FL_BUTTON1){
m_end_pos[0] = x;
m_end_pos[1] = y;
m_rubber_on = true;

show();
redraw_overlay();
}
return 1;

case FL_RELEASE:
if(event_b & 1){
int w = abs(m_start_pos[0] - x);
int h = abs(m_start_pos[1] - y);

//if dragging selection
int mid_x = (m_start_pos[0] + x)/2;
int mid_y = (m_start_pos[1] + y)/2;

m_rubber_on = false;

comp_selection();

//clear the 2d box
show();
redraw_overlay();
}

}
return 1;

default:
return Fl_Gl_Window::handle(event);
}
}
}




Actually even fltk/test/gl_overlay.cxx causes Xserver to crash.
When I check Fl_Gl_Window::can_do_overlay(), I get false (0) value. So I suppose the problem is in hardware, not in the actual code??

In redhat 9 machine, I get error like this as I start up the viewer- Xlib: extension "XFree86-DRI" missing on display ":0.0".
In redhat 7, the Xserver just crashes.
Is it something with hardware configuration??

Thanks for your help in advance!!!
-SJ

Share this post


Link to post
Share on other sites
Hi,
I'll try to write some pseudo code for part of my applcation since it's too long..


void Viewer::draw_overlay(void)
{
if (m_rubber_on){
glLineWidth(2);
glLineStipple( 3, 0xAAAA );
glEnable( GL_LINE_STIPPLE );
glDisable(GL_DEPTH_TEST);

glLoadIdentity();
glViewport(0,0,m_width, m_height);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D( 0, m_width, m_height, 0 );

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

GLfloat color1[4] = {1.0, 0.0, 0.0, 1.0};
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, color1);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, color1);

glBegin( GL_LINE_LOOP );
glVertex2i( m_start_pos[0], m_start_pos[1]);
glVertex2i( m_end_pos[0], m_start_pos[1]);
glVertex2i( m_end_pos[0], m_end_pos[1]);
glVertex2i( m_start_pos[0], m_end_pos[1]);
glEnd();
}
glEnable(GL_DEPTH_TEST);
}

int Viewer::handle(int event)
{
unsigned long state = Fl::event_state();
int event_b = Fl::event_button();
int x = Fl::event_x();
int y = Fl::event_y();

if (m_mode == COMP_SELECTION){
switch(event){
case FL_PUSH:
if(state & FL_BUTTON1){
m_start_pos[0] = x;
m_start_pos[1] = y;
}
return 1;

case FL_DRAG:
if(state & FL_BUTTON1){
m_end_pos[0] = x;
m_end_pos[1] = y;
m_rubber_on = true;

show();
redraw_overlay();
}
return 1;

case FL_RELEASE:
if(event_b & 1){
int w = abs(m_start_pos[0] - x);
int h = abs(m_start_pos[1] - y);

//if dragging selection
int mid_x = (m_start_pos[0] + x)/2;
int mid_y = (m_start_pos[1] + y)/2;

m_rubber_on = false;

comp_selection();

//clear the 2d box
show();
redraw_overlay();
}

}
return 1;

default:
return Fl_Gl_Window::handle(event);
}
}
}




Actually even fltk/test/gl_overlay.cxx causes Xserver to crash.
When I check Fl_Gl_Window::can_do_overlay(), I get false (0) value. So I suppose the problem is in hardware, not in the actual code??

In redhat 9 machine, I get error like this as I start up the viewer- Xlib: extension "XFree86-DRI" missing on display ":0.0".
In redhat 7, the Xserver just crashes.
Is it something with hardware configuration??

Thanks for your help in advance!!!
-SJ

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!