Pārlūkot izejas kodu

gpu: use the RenderContext class in a few friendly places.

legacy
Sam Hocevar sam pirms 11 gadiem
vecāks
revīzija
b97cbbe27f
2 mainītis faili ar 8 papildinājumiem un 6 dzēšanām
  1. +4
    -4
      src/scene.cpp
  2. +4
    -2
      tutorial/08_fbo.cpp

+ 4
- 4
src/scene.cpp Parādīt failu

@@ -191,15 +191,17 @@ Array<Light *> const &Scene::GetLights() const

void Scene::Render() // XXX: rename to Blit()
{
RenderContext rc;
rc.SetDepthTest(true);
rc.SetAlphaBlend(true);

#if defined USE_D3D9 || defined _XBOX
#else
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
#if defined HAVE_GL_2X && !defined __APPLE__
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GEQUAL, 0.01f);
#endif
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
#endif

@@ -347,11 +349,9 @@ void Scene::Render() // XXX: rename to Blit()
#if defined USE_D3D9 || defined _XBOX
/* TODO */
#else
glDisable(GL_DEPTH_TEST);
# if defined HAVE_GL_2X && !defined __APPLE__
glDisable(GL_ALPHA_TEST);
# endif
glDisable(GL_BLEND);
#endif
}



+ 4
- 2
tutorial/08_fbo.cpp Parādīt failu

@@ -83,9 +83,11 @@ public:
/* FIXME: this object never cleans up */
}

m_fbo->Bind();
/* FIXME: we should just disable depth test in the shader */
Video::Clear(ClearMask::Depth);
RenderContext rc;
rc.SetDepthTest(false);

m_fbo->Bind();
m_shader->Bind();

#if _XBOX


Notiek ielāde…
Atcelt
Saglabāt