mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 02:23:57 +02:00
Fixing the 0.6 Oculus plugin
This commit is contained in:
parent
2a1776303d
commit
e459d0cb83
3 changed files with 9 additions and 13 deletions
|
@ -126,14 +126,15 @@ bool OpenGLDisplayPlugin::eventFilter(QObject* receiver, QEvent* event) {
|
|||
void OpenGLDisplayPlugin::display(
|
||||
GLuint finalTexture, const glm::uvec2& sceneSize) {
|
||||
using namespace oglplus;
|
||||
|
||||
uvec2 size = getRecommendedRenderSize();
|
||||
Context::Viewport(size.x, size.y);
|
||||
glClearColor(1, 0, 1, 1);
|
||||
Context::Clear().ColorBuffer();
|
||||
|
||||
_program->Bind();
|
||||
glBindTexture(GL_TEXTURE_2D, finalTexture);
|
||||
drawUnitQuad();
|
||||
}
|
||||
|
||||
void OpenGLDisplayPlugin::drawUnitQuad() {
|
||||
using namespace oglplus;
|
||||
_program->Bind();
|
||||
_vertexBuffer->Bind(Buffer::Target::Array);
|
||||
glEnableVertexAttribArray(_positionAttribute);
|
||||
glVertexAttribPointer(_positionAttribute, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, 0);
|
||||
|
@ -144,4 +145,4 @@ void OpenGLDisplayPlugin::display(
|
|||
glDisableVertexAttribArray(_texCoordAttribute);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glUseProgram(0);
|
||||
}
|
||||
}
|
|
@ -35,7 +35,7 @@ protected:
|
|||
// Needs to be called by the activate method after the GL context has been created to
|
||||
// initialize OpenGL context settings needed by the plugin
|
||||
virtual void customizeContext(PluginContainer * container);
|
||||
|
||||
virtual void drawUnitQuad();
|
||||
virtual void makeCurrent() = 0;
|
||||
virtual void doneCurrent() = 0;
|
||||
virtual void swapBuffers() = 0;
|
||||
|
|
|
@ -245,13 +245,8 @@ void Oculus_0_6_DisplayPlugin::display(GLuint finalTexture, const glm::uvec2& sc
|
|||
_sceneFbo->Bound([&] {
|
||||
auto size = _sceneFbo->size;
|
||||
Context::Viewport(size.x, size.y);
|
||||
|
||||
_program->Bind();
|
||||
Mat4Uniform(*_program, "Projection").Set(mat4());
|
||||
Mat4Uniform(*_program, "ModelView").Set(mat4());
|
||||
glBindTexture(GL_TEXTURE_2D, finalTexture);
|
||||
_plane->Use();
|
||||
_plane->Draw();
|
||||
drawUnitQuad();
|
||||
});
|
||||
|
||||
ovrLayerEyeFov& sceneLayer = getSceneLayer();
|
||||
|
|
Loading…
Reference in a new issue