pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

SDL_GL_LoadLibrary() is unable to find

hi everyone,

I try to make a 3d game. I'm just in the beginning but it seems that
there is a problem: when using SDL_GL_LoadLibrary() to load
it seems that it can't find it even if I compile "-L/usr/X11R7/lib
-Wl,-rpath,/usr/X11R7/lib -lGL", I don't know what I do which is
wrong. here is the faulty code:

int    CreateWindow::Initialise()
  if (SDL_Init(SDL_INIT_VIDEO) == -1)
      std::cerr << "Can't init SDL" << std::endl;
      return (-1);
  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_ALPHA_SIZE, 5);
  SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
  if (SDL_GL_LoadLibrary(NULL) == -1);
      std::cerr << "Can't load OpenGL library: " << SDL_GetError() << std::endl;
      return (-1);
  screen = SDL_SetVideoMode(width, height, bpp, SDL_OPENGL);
  if (screen == NULL)
      std::cerr << "Can't set video mode: " << SDL_GetError() << std::endl;
      return (-1);
  SDL_Event resizeEvent;
  return (0);

if I suppress the SDL_GL_LoadLibrary() or if I put ""
parameter in it, it change anything, SDL_GetError() return "Failed
I don't know what to do next to find out where the problem is...

Home | Main Index | Thread Index | Old Index