• Content count

  • Joined

  • Last visited

Community Reputation

106 Neutral

About nooblz

  • Rank
  1. OpenGL + SDL

    Sorry to just randomly jump in here but I was looking through gamedev and just decided to create an account because I saw this question. I am new to SDL and openGL but I thought maybe I could help with a bit of code from one of my projects. This may be helpful or may not, but it does seem to answer the question of how to get SDL_SWSURFACE and SDL_OPENGL on at the same time. [source lang="cpp"] int videoFlags; const SDL_VideoInfo* videoInfo; SDL_Init( SDL_INIT_EVERYTHING ); videoInfo = SDL_GetVideoInfo(); if(!videoInfo) return false; videoFlags = SDL_OPENGL; videoFlags |= SDL_GL_DOUBLEBUFFER; videoFlags |= SDL_HWPALETTE; videoFlags |= SDL_RESIZABLE; if( videoInfo->hw_available ) videoFlags |= SDL_HWSURFACE; else videoFlags |= SDL_SWSURFACE; if( videoInfo->blit_hw ) videoFlags |= SDL_HWACCEL; SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); screen = SDL_SetVideoMode( screenW,screenH,screenBPP,videoFlags );[/source]