Bläddra i källkod

Activate depth buffer when the GL context is created.

legacy
Sam Hocevar sam 14 år sedan
förälder
incheckning
3f21eb34d2
3 ändrade filer med 4 tillägg och 1 borttagningar
  1. +1
    -0
      src/gtk/glmapview.cpp
  2. +1
    -1
      src/scene.cpp
  3. +2
    -0
      src/test-map.cpp

+ 1
- 0
src/gtk/glmapview.cpp Visa fil

@@ -30,6 +30,7 @@ GlMapView::GlMapView(GtkBuilder *builder)
GDK_GL_RED_SIZE, 1,
GDK_GL_GREEN_SIZE, 1,
GDK_GL_BLUE_SIZE, 1,
GDK_GL_DEPTH_SIZE, 16,
GDK_GL_DOUBLEBUFFER,
GDK_GL_NONE
};


+ 1
- 1
src/scene.cpp Visa fil

@@ -99,7 +99,7 @@ void Scene::Render() // XXX: rename to Blit()
static float f = 0.0f;
f += 0.05f;
glTranslatef(320.0f, 240.0f, 0.0f);
glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
glRotatef(-45.0f, 1.0f, 0.0f, 0.0f);
#if 0
glRotatef(3.0f * sinf(f), 1.0f, 0.0f, 0.0f);
glRotatef(8.0f * cosf(f), 0.0f, 0.0f, 1.0f);


+ 2
- 0
src/test-map.cpp Visa fil

@@ -30,6 +30,8 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}

SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_Surface *video = SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);
if (!video)
{


Laddar…
Avbryt
Spara