SDL + CEGUI + openGL display problem

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

kewur
Just popping in
Just popping in
Posts: 17
Joined: Fri Dec 05, 2008 00:05

SDL + CEGUI + openGL display problem

Postby kewur » Wed Mar 11, 2009 19:52

Hello

I have set my app for SDL and CEGUI

i have put some events to fire . like when pushing a button drawing a square or tea pot.

my code is like this

Code: Select all

bool DrawSquare(const CEGUI::EventArgs &e)
   {

   
   glutDisplayFunc(dene);

   return true;

   }


and the dene function is

Code: Select all

void dene()
   {

   glutWireTeapot(3.2)


   }



what may be the problem ? when i click draw square it crashes without any warning and in debug it doesnt seem to show me where the problem is

kewur
Just popping in
Just popping in
Posts: 17
Joined: Fri Dec 05, 2008 00:05

Postby kewur » Wed Mar 11, 2009 21:55

since i cant find any function to draw lines with SDL

this is the code where i initilise SDL

void setupSDL()
{

if ((SDL_Init(SDL_INIT_VIDEO))<0)
{
fprintf(stderr, "Unable to initialise SDL: %s", SDL_GetError());
exit(0);
}

if ((surface = SDL_SetVideoMode(800,600,0,SDL_OPENGL))==NULL)
{
fprintf(stderr, "Unable to set OpenGL videomode: %s", SDL_GetError());
SDL_Quit();
exit(0);

}


SDL_WM_SetCaption("CSE452 Paint Program", NULL);

//Draw_Line(surface, 100,100, 30,0, 3);

//gluLookAt(100, 0, 20, 0, 0, -1, 0, 1, 0);
glEnable(GL_CULL_FACE);

glDisable(GL_FOG);

glClearColor(.2f,.3f,.3f,1.0f);



//glViewport(0,0, 800,600);

SDL_ShowCursor(SDL_DISABLE);

SDL_EnableUNICODE(1);


}


i was thinking if i may have the camera position wrong.
btw i found a SDL_draw library im trying to get it work right now. but its stubborn.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Mar 14, 2009 08:27

Hi,

With regards to the crash, <shrugs>. What type of crash is it? A segfault or something, or maybe an application exception? Anything in the log? Remember, you have all the information and couldn't identify the issue, we have only the information you posted - what chance do we have of identifying issues from that information? Help us to help you :)

I don't understand the second post at all; was there a question in there somewhere? ;) With regards to cameras and CEGUI, that makes no difference since CEGUI is always renders in screen-space.

CE.

LennyH
Quite a regular
Quite a regular
Posts: 92
Joined: Thu Nov 30, 2006 20:50

Postby LennyH » Tue Mar 17, 2009 17:29

I haven't messed with openGL direct in a long long time, but shouldn't you be doing some form of glClear and glFlush before and after the teapot?


Return to “Help”

Who is online

Users browsing this forum: No registered users and 3 guests