set depth range for 3d, flush 3d before starting with 2d
This commit is contained in:
parent
81015b1079
commit
ea664944bb
@ -192,6 +192,7 @@ static bool initialize(void) {
|
||||
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
|
||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
|
||||
|
||||
if (ctx.debug)
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
|
||||
|
@ -113,6 +113,7 @@ static void render_space(void) {
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_TRUE);
|
||||
glDepthFunc(GL_LESS);
|
||||
glDepthRange(0, 1);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
@ -175,6 +176,7 @@ void render(void) {
|
||||
|
||||
/* TODO: only do it when transition between spaces is needed */
|
||||
glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
glFlush();
|
||||
|
||||
{
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
|
Loading…
Reference in New Issue
Block a user