Merge branch 'simple_math_single_header' of ssh://i13s.de/martin/protot into simple_math_single_header

simple_math_single_header
Martin Felis 2018-12-23 11:21:00 +01:00
commit c1b39036db
4 changed files with 8 additions and 27 deletions

View File

@ -119,7 +119,7 @@ int main(void)
const char* glsl_version = "#version 130"; const char* glsl_version = "#version 130";
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_SAMPLES, 16); glfwWindowHint(GLFW_SAMPLES, 16);
// glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

View File

@ -867,28 +867,6 @@ void Renderer::RenderGl() {
if (mDrawDebugCamera) { if (mDrawDebugCamera) {
DebugDrawShadowCascades(); DebugDrawShadowCascades();
} }
if (mUseDeferred) {
// Blit the deferred result onto the main render target
// glBindFramebuffer
glBindFramebuffer(GL_READ_FRAMEBUFFER, mDeferredLightingTarget.mFrameBufferId);
glReadBuffer(GL_COLOR_ATTACHMENT0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mForwardRenderingTarget.mFrameBufferId);
GLenum buffers[] = { GL_COLOR_ATTACHMENT0};
glDrawBuffers (1, buffers);
glBlitFramebuffer(
0, mDeferredLightingTarget.mWidth,
0, mDeferredLightingTarget.mHeight,
0, mForwardRenderingTarget.mWidth,
0, mForwardRenderingTarget.mHeight,
GL_COLOR_BUFFER_BIT,
GL_NEAREST
);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
} }
void Renderer::DebugDrawShadowCascades() { void Renderer::DebugDrawShadowCascades() {

View File

@ -76,10 +76,10 @@ struct Renderer {
bool mUseDeferred = false; bool mUseDeferred = false;
bool mDrawDebugCamera = false; bool mDrawDebugCamera = false;
uint32_t mWidth = 1; int mWidth = 1;
uint32_t mHeight = 1; int mHeight = 1;
uint32_t mSceneAreaWidth = 1; int mSceneAreaWidth = 1;
uint32_t mSceneAreaHeight = 1; int mSceneAreaHeight = 1;
Light mLight; Light mLight;
Camera mCamera; Camera mCamera;

View File

@ -668,6 +668,9 @@ bool VertexArray::IsBound() {
} }
void VertexArrayMesh::Initialize(VertexArray &array, const int& size) { void VertexArrayMesh::Initialize(VertexArray &array, const int& size) {
mIndexBuffer = -1;
mIndexCount = -1;
mVertexArray = &array; mVertexArray = &array;
mIndexOffset = mVertexArray->AllocateMesh(size); mIndexOffset = mVertexArray->AllocateMesh(size);
mOffsetPtr = (void*) (sizeof(VertexArray::VertexData) * mIndexOffset); mOffsetPtr = (void*) (sizeof(VertexArray::VertexData) * mIndexOffset);