From dd2ff06cf9da3eeb9b933d1152f3175a8ce9fec3 Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Date: Mon, 28 Jan 2013 06:06:46 +0000 Subject: [PATCH] removing Halibut Engine --- .../HalibutRender/HalibutRenderAndroid.cpp | 7 - .../HalibutRender/HalibutRenderGLES20.cpp | 50 --- .../HalibutRender/HalibutRenderInterface.cpp | 141 -------- src/Render/HalibutRender/HalibutRenderIos.cpp | 8 - .../HalibutRender/HalibutRenderWindows.cpp | 312 ------------------ 5 files changed, 518 deletions(-) delete mode 100644 src/Render/HalibutRender/HalibutRenderAndroid.cpp delete mode 100644 src/Render/HalibutRender/HalibutRenderGLES20.cpp delete mode 100644 src/Render/HalibutRender/HalibutRenderInterface.cpp delete mode 100644 src/Render/HalibutRender/HalibutRenderIos.cpp delete mode 100644 src/Render/HalibutRender/HalibutRenderWindows.cpp diff --git a/src/Render/HalibutRender/HalibutRenderAndroid.cpp b/src/Render/HalibutRender/HalibutRenderAndroid.cpp deleted file mode 100644 index 1b7d530..0000000 --- a/src/Render/HalibutRender/HalibutRenderAndroid.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "include/Engine.h" -#include "include/Render/HalibutRender/HalibutRenderAndroid.h" - -namespace SE -{ - -} //namespace SE \ No newline at end of file diff --git a/src/Render/HalibutRender/HalibutRenderGLES20.cpp b/src/Render/HalibutRender/HalibutRenderGLES20.cpp deleted file mode 100644 index f9288f8..0000000 --- a/src/Render/HalibutRender/HalibutRenderGLES20.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "include/Engine.h" -#include "include/Render/HalibutRender/HalibutRenderGLES20.h" - -namespace SE -{ - -THalibutRendererGLES20::THalibutRendererGLES20() -{ - ProjectionMatrixStack.push(IdentityMatrix4); - ModelviewMatrixStack.push(IdentityMatrix4); - *Console<<"Halibut Render created\n"; -} - -THalibutRendererGLES20::~THalibutRendererGLES20() -{ - *Console<<"Halibut Render destroying\n"; -} - -void THalibutRendererGLES20::DrawQuad(const T2DQuad& quad) -{ - - VertexAttribPointer3fv(CONST_STRING_POSITION_ATTRIB, 0, reinterpret_cast(quad.VertexCoord)); - VertexAttribPointer2fv(CONST_STRING_TEXCOORD_ATTRIB, 0, reinterpret_cast(quad.TextureCoord)); - - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - -} - -void THalibutRendererGLES20::DrawTriangleList(const TTriangleList& triangleList) -{ - - for (std::map >::iterator i = triangleList.Data.Vec2CoordArr.begin(); i != triangleList.Data.Vec2CoordArr.end(); ++i ) - { - VertexAttribPointer2fv(i->first, 0, reinterpret_cast(&triangleList.Data.Vec2CoordArr[i->first][0])); - } - - for (std::map >::iterator i = triangleList.Data.Vec3CoordArr.begin(); i != triangleList.Data.Vec3CoordArr.end(); ++i ) - { - VertexAttribPointer3fv(i->first, 0, reinterpret_cast(&triangleList.Data.Vec3CoordArr[i->first][0])); - } - - if (!triangleList.Data.Vec3CoordArr.empty()) - { - glDrawArrays(GL_TRIANGLES,0,triangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB].size()); - } - -} - - -} //namespace SE \ No newline at end of file diff --git a/src/Render/HalibutRender/HalibutRenderInterface.cpp b/src/Render/HalibutRender/HalibutRenderInterface.cpp deleted file mode 100644 index 2e4bda1..0000000 --- a/src/Render/HalibutRender/HalibutRenderInterface.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "include/Engine.h" - -namespace SE -{ - -void THalibutRendererInterface::SetUniforms() -{ - - if (ProjectionMatrixStack.size() <=0) - { - throw ErrorToLog("Projection matrix stack out!"); - } - - if (ModelviewMatrixStack.size() <=0) - { - throw ErrorToLog("Modelview matrix stack out!"); - } - - ProjectionModelviewMatrix = MultMatrixMatrix(ProjectionMatrixStack.top(), ModelviewMatrixStack.top()); - RenderUniformMatrix4fv(CONST_STRING_HALIBUT_PROJECTION_MATRIX_UNIFORM, false, ProjectionModelviewMatrix.m); - - //Refactoring! - - RenderUniform1i(CONST_STRING_TEXTURE_UNIFORM, 0); - RenderUniform1i(CONST_STRING_NORMALMAP_UNIFORM, 1); - - RenderUniform1f(CONST_STRING_TRANSPARENCY_UNIFORM, 1.f); - - RenderUniform4fv(CONST_STRING_MATERIAL_COLOR_UNIFORM, WhiteColor); - - - /* - RenderUniform1i(CONST_STRING_SHADOWMAPGLOBAL_UNIFORM,2); - RenderUniform1i(CONST_STRING_SHADOWMAPLOCAL_UNIFORM,3); - - RenderUniform1i(CONST_STRING_NORMALMAPEXISTS_UNIFORM,1); - RenderUniform1i(CONST_STRING_ENV_UNIFORM,0);*/ -} - -void THalibutRendererInterface::InitOpenGL(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight) -{ - - *Console<<"Halibut Render OpenGL init\n"; - - #ifdef TARGET_WIN32 - glEnable(GL_NORMALIZE); - glEnable(GL_TEXTURE_2D); - #endif - - glDisable(GL_DEPTH_TEST); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - ScreenWidth = screenWidth; - ScreenHeight = screenHeight; - - MatrixWidth = matrixWidth; - MatrixHeight = matrixHeight; - - while (!ProjectionMatrixStack.empty()) - { - ProjectionMatrixStack.pop(); - } - ProjectionMatrixStack.push(MakeOrthoMatrix(matrixWidth, matrixHeight)); - - while (!ModelviewMatrixStack.empty()) - { - ModelviewMatrixStack.pop(); - } - ModelviewMatrixStack.push(IdentityMatrix4); - - glViewport(0, 0, ScreenWidth, ScreenHeight); - - SetUniforms(); - #ifndef TARGET_IOS - SwitchToScreen(); - #endif - - CheckGlError(); - -} - -void THalibutRendererInterface::SwitchToScreen() -{ - //TODO: fix this stupid bug -#ifdef TARGET_IOS - glBindFramebuffer(GL_FRAMEBUFFER, 2); -#else - glBindFramebuffer(GL_FRAMEBUFFER, 0); -#endif - glViewport(0, 0, ScreenWidth, ScreenHeight); - SetProjectionMatrix(MatrixWidth, MatrixHeight); - SetUniforms(); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); -} - -void THalibutRendererInterface::SwitchToFrameBuffer(const std::string& frameName) -{ - if (ResourceManager->FrameManager.FrameMap.count(frameName) > 0) - { - TFrame& Frame = ResourceManager->FrameManager.FrameMap[frameName]; - - glBindFramebuffer(GL_FRAMEBUFFER, Frame.FrameBuffer); - glViewport(0, 0, Frame.Width, Frame.Height); - SetProjectionMatrix(static_cast(Frame.Width), static_cast(Frame.Height)); - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - } -} - -void THalibutRendererInterface::PrintMatrices() -{ - mat4 proj = ProjectionMatrixStack.top(); - mat4 modv = ModelviewMatrixStack.top(); - *Console<<"Projection:\n "; - for (int i=0; i<16; i++) - { - *Console<::const_iterator vertexIterator = triangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB].begin(); - std::vector::const_iterator texcoordIterator = triangleList.Data.Vec2CoordArr[CONST_STRING_TEXCOORD_ATTRIB].begin(); - - for (int i=0; iv); - VertexAttrib3fv(CONST_STRING_POSITION_ATTRIB, (vertexIterator++)->v); - VertexAttrib2fv(CONST_STRING_TEXCOORD_ATTRIB, (texcoordIterator++)->v); - VertexAttrib3fv(CONST_STRING_POSITION_ATTRIB, (vertexIterator++)->v); - VertexAttrib2fv(CONST_STRING_TEXCOORD_ATTRIB, (texcoordIterator++)->v); - VertexAttrib3fv(CONST_STRING_POSITION_ATTRIB, (vertexIterator++)->v); - glEnd(); - } -} - - - -void THalibutRenderer::DrawTriangleList(const TTriangleList& triangleList) -{ - - //for (std::map >::iterator i = triangleList.Vec2CoordArr.begin(); i != triangleList.Vec2CoordArr.end(); ++i ) - BOOST_FOREACH(auto& i, triangleList.Data.Vec2CoordArr) - { - glBindBuffer(GL_ARRAY_BUFFER, triangleList.VertBufferArr[i.first]->Buffer); - VertexAttribPointer2fv(i.first, 0, NULL); - } - - //for (std::map >::iterator i = triangleList.Vec3CoordArr.begin(); i != triangleList.Vec3CoordArr.end(); ++i ) - BOOST_FOREACH(auto& i, triangleList.Data.Vec3CoordArr) - { - glBindBuffer(GL_ARRAY_BUFFER, triangleList.VertBufferArr[i.first]->Buffer); - VertexAttribPointer3fv(i.first, 0, NULL); - } - - if (!triangleList.Data.Vec3CoordArr.empty()) - { - glDrawArrays(GL_TRIANGLES,0,triangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB].size()); - } - -} - -} //namespace SE - \ No newline at end of file