Merge branch 'simple_math_single_header' of ssh://i13s.de/martin/protot into simple_math_single_header
commit
c1b39036db
|
@ -119,7 +119,7 @@ int main(void)
|
|||
const char* glsl_version = "#version 130";
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||
glfwWindowHint(GLFW_SAMPLES, 16);
|
||||
// glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
|
||||
|
|
|
@ -867,28 +867,6 @@ void Renderer::RenderGl() {
|
|||
if (mDrawDebugCamera) {
|
||||
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() {
|
||||
|
|
|
@ -76,10 +76,10 @@ struct Renderer {
|
|||
bool mUseDeferred = false;
|
||||
bool mDrawDebugCamera = false;
|
||||
|
||||
uint32_t mWidth = 1;
|
||||
uint32_t mHeight = 1;
|
||||
uint32_t mSceneAreaWidth = 1;
|
||||
uint32_t mSceneAreaHeight = 1;
|
||||
int mWidth = 1;
|
||||
int mHeight = 1;
|
||||
int mSceneAreaWidth = 1;
|
||||
int mSceneAreaHeight = 1;
|
||||
|
||||
Light mLight;
|
||||
Camera mCamera;
|
||||
|
|
|
@ -668,6 +668,9 @@ bool VertexArray::IsBound() {
|
|||
}
|
||||
|
||||
void VertexArrayMesh::Initialize(VertexArray &array, const int& size) {
|
||||
mIndexBuffer = -1;
|
||||
mIndexCount = -1;
|
||||
|
||||
mVertexArray = &array;
|
||||
mIndexOffset = mVertexArray->AllocateMesh(size);
|
||||
mOffsetPtr = (void*) (sizeof(VertexArray::VertexData) * mIndexOffset);
|
||||
|
|
Loading…
Reference in New Issue