Please, excuse my bad english.
I use Linux, OpenGL 1.4 (Intel Linux drivers sucks) and SDL 1.2.14
I'm beginning in OpenGL and I'm doing any simple programs to experiment, now I'm exporting a "game" done with GLUT to SDL. g++ don't gives me any error, but when I run the program, it crashes before do anything.
Valgrind says a lot of things, but the latest are:
Quote:==8410== Invalid read of size 8
==8410== at 0x42E77AF: (within /lib/tls/i686/cmov/libc-2.11.1.so)
==8410== by 0x440E886: XrmGetStringDatabase (in /usr/lib/libX11.so.6.2.0)
==8410== by 0x43EB3B9: (within /usr/lib/libX11.so.6.2.0)
==8410== by 0x43EB5AE: XGetDefault (in /usr/lib/libX11.so.6.2.0)
==8410== by 0x4A77313: _XcursorGetDisplayInfo (in /usr/lib/libXcursor.so.1.0.2)
==8410== by 0x4A7754C: XcursorSupportsARGB (in /usr/lib/libXcursor.so.1.0.2)
==8410== by 0x4A79CA5: XcursorNoticeCreateBitmap (in /usr/lib/libXcursor.so.1.0.2)
==8410== by 0x43E4F74: _XNoticeCreateBitmap (in /usr/lib/libX11.so.6.2.0)
==8410== by 0x43E51CC: XCreatePixmap (in /usr/lib/libX11.so.6.2.0)
==8410== by 0x40C7659: XCreatePixmap (SDL_x11sym.h:38)
==8410== by 0x40D0A3F: X11_CreateWMCursor (SDL_x11mouse.c:104)
==8410== by 0x40D3CED: X11_VideoInit (SDL_x11video.c:691)
==8410== Address 0x4532358 is 0 bytes after a block of size 14,104 alloc'd
==8410== at 0x4025D2E: malloc (vg_replace_malloc.c:207)
==8410== by 0x43F7A23: XOpenDisplay (in /usr/lib/libX11.so.6.2.0)
==8410== by 0x40C7FCD: XOpenDisplay (SDL_x11sym.h:78)
==8410== by 0x40D3A63: X11_VideoInit (SDL_x11video.c:574)
==8410== by 0x40BF032: SDL_VideoInit (SDL_video.c:246)
==8410== by 0x4091C17: SDL_InitSubSystem (SDL.c:70)
==8410== by 0x4091C76: SDL_Init (SDL.c:162)
==8410== by 0x8049C33: AGEGame::createEnv(int, int, int, int, char*, unsigned, int, char**) (AGE_core.cpp:65)
==8410== by 0x804A31A: main (prueba2.cpp:183)
And here is the function createEng, when I don't found any error.
void AGEGame::createEnv (int x, int y, int w, int h, char *name, unsigned int mode, int argc, char* argv[]) { /*glutInit(&argc, argv); glutInitDisplayMode(mode); glutInitWindowPosition(x,y); glutInitWindowSize(w,h); glutCreateWindow(name);*/ const SDL_VideoInfo *info = SDL_GetVideoInfo( ); SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); screen = SDL_SetVideoMode(w, h, info->vfmt->BitsPerPixel, SDL_OPENGL); istimer = false; env = true; xpos = x; ypos = y; height = h; width = w; game_name = name; gmode = mode;}
Thanks and, again, excuse my english.