Cleanup methods in KRCamera that should be private

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4068
This commit is contained in:
kearwood
2012-08-16 17:51:27 +00:00
parent 8071731b7a
commit 721d25f0ed
4 changed files with 7 additions and 7 deletions

View File

@@ -352,7 +352,7 @@ void KRCamera::renderFrame(KRContext &context, KRScene &scene, KRMat4 &viewMatri
} }
void KRCamera::createBuffers() { void KRCamera::createBuffers(KRContext &context) {
// ===== Create offscreen compositing framebuffer object ===== // ===== Create offscreen compositing framebuffer object =====
glGenFramebuffers(1, &compositeFramebuffer); glGenFramebuffers(1, &compositeFramebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, compositeFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, compositeFramebuffer);
@@ -394,6 +394,7 @@ void KRCamera::createBuffers() {
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, lightAccumulationTexture, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, lightAccumulationTexture, 0);
allocateShadowBuffers(); allocateShadowBuffers();
loadShaders(context);
} }
void KRCamera::allocateShadowBuffers() { void KRCamera::allocateShadowBuffers() {

View File

@@ -58,9 +58,7 @@ public:
void invalidatePostShader(); void invalidatePostShader();
void invalidateShadowBuffers(); void invalidateShadowBuffers();
void allocateShadowBuffers(); void allocateShadowBuffers();
void createBuffers(); void createBuffers(KRContext &context);
void loadShaders(KRContext &context);
KRVector3 getPosition() const; KRVector3 getPosition() const;
void setPosition(const KRVector3 &position); void setPosition(const KRVector3 &position);
@@ -163,6 +161,8 @@ private:
void renderFrame(KRContext &context, KRScene &scene, KRMat4 &viewMatrix, KRVector3 &lightDirection, KRVector3 &cameraPosition); void renderFrame(KRContext &context, KRScene &scene, KRMat4 &viewMatrix, KRVector3 &lightDirection, KRVector3 &cameraPosition);
void loadShaders(KRContext &context);
// Code using these shader functions will later be refactored to integrate with KRShaderManager // Code using these shader functions will later be refactored to integrate with KRShaderManager
static bool ValidateProgram(GLuint prog); static bool ValidateProgram(GLuint prog);
static bool LoadShader(KRContext &context, const std::string &name, GLuint *programPointer, const std::string &options); static bool LoadShader(KRContext &context, const std::string &name, GLuint *programPointer, const std::string &options);

View File

@@ -59,8 +59,7 @@ double const PI = 3.141592653589793f;
m_camera.backingWidth = width; m_camera.backingWidth = width;
m_camera.backingHeight = height; m_camera.backingHeight = height;
m_camera.createBuffers(); m_camera.createBuffers(m_context);
m_camera.loadShaders(m_context);
} }

View File

@@ -201,7 +201,7 @@
- (KRScene *)getScene; - (KRScene *)getScene;
{ {
return renderEngine.context->getSceneManager()->getFirstScene(); return renderEngine.context.getSceneManager()->getFirstScene();
} }
#pragma mark - #pragma mark -