mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-21 19:09:15 +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(
|
void OpenGLDisplayPlugin::display(
|
||||||
GLuint finalTexture, const glm::uvec2& sceneSize) {
|
GLuint finalTexture, const glm::uvec2& sceneSize) {
|
||||||
using namespace oglplus;
|
using namespace oglplus;
|
||||||
|
|
||||||
uvec2 size = getRecommendedRenderSize();
|
uvec2 size = getRecommendedRenderSize();
|
||||||
Context::Viewport(size.x, size.y);
|
Context::Viewport(size.x, size.y);
|
||||||
glClearColor(1, 0, 1, 1);
|
|
||||||
Context::Clear().ColorBuffer();
|
|
||||||
|
|
||||||
_program->Bind();
|
|
||||||
glBindTexture(GL_TEXTURE_2D, finalTexture);
|
glBindTexture(GL_TEXTURE_2D, finalTexture);
|
||||||
|
drawUnitQuad();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenGLDisplayPlugin::drawUnitQuad() {
|
||||||
|
using namespace oglplus;
|
||||||
|
_program->Bind();
|
||||||
_vertexBuffer->Bind(Buffer::Target::Array);
|
_vertexBuffer->Bind(Buffer::Target::Array);
|
||||||
glEnableVertexAttribArray(_positionAttribute);
|
glEnableVertexAttribArray(_positionAttribute);
|
||||||
glVertexAttribPointer(_positionAttribute, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, 0);
|
glVertexAttribPointer(_positionAttribute, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 4, 0);
|
||||||
|
|
|
@ -35,7 +35,7 @@ protected:
|
||||||
// Needs to be called by the activate method after the GL context has been created to
|
// Needs to be called by the activate method after the GL context has been created to
|
||||||
// initialize OpenGL context settings needed by the plugin
|
// initialize OpenGL context settings needed by the plugin
|
||||||
virtual void customizeContext(PluginContainer * container);
|
virtual void customizeContext(PluginContainer * container);
|
||||||
|
virtual void drawUnitQuad();
|
||||||
virtual void makeCurrent() = 0;
|
virtual void makeCurrent() = 0;
|
||||||
virtual void doneCurrent() = 0;
|
virtual void doneCurrent() = 0;
|
||||||
virtual void swapBuffers() = 0;
|
virtual void swapBuffers() = 0;
|
||||||
|
|
|
@ -245,13 +245,8 @@ void Oculus_0_6_DisplayPlugin::display(GLuint finalTexture, const glm::uvec2& sc
|
||||||
_sceneFbo->Bound([&] {
|
_sceneFbo->Bound([&] {
|
||||||
auto size = _sceneFbo->size;
|
auto size = _sceneFbo->size;
|
||||||
Context::Viewport(size.x, size.y);
|
Context::Viewport(size.x, size.y);
|
||||||
|
|
||||||
_program->Bind();
|
|
||||||
Mat4Uniform(*_program, "Projection").Set(mat4());
|
|
||||||
Mat4Uniform(*_program, "ModelView").Set(mat4());
|
|
||||||
glBindTexture(GL_TEXTURE_2D, finalTexture);
|
glBindTexture(GL_TEXTURE_2D, finalTexture);
|
||||||
_plane->Use();
|
drawUnitQuad();
|
||||||
_plane->Draw();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ovrLayerEyeFov& sceneLayer = getSceneLayer();
|
ovrLayerEyeFov& sceneLayer = getSceneLayer();
|
||||||
|
|
Loading…
Reference in a new issue