glfw/examples/DeferredRendering/GLApplication.h
2017-09-22 11:01:51 +08:00

46 lines
1008 B
C++

#pragma once
#include <windows.h>
#include "DeferredRendering/DeferredRendering.h"
#include "DeferredRendering/FBORenderTexture.h"
//Fwd
class IModel;
/**
* This class contains all the system stuff that we need to render with OpenGL
*/
class GLApplication {
public:
// Methods
bool initialize(HWND hwnd, int w, int h);
void setSize(int w, int h);
void update();
void render();
void release();
void showDeferredRendering(){ m_state = 0; }
void showRenderTargets(){ m_state = 1; }
private:
// Methods
void loadAssets();
void releaseAssets();
// Static consts
static const int c_modelsCount = 3;
// Fields
IModel* m_models[c_modelsCount];
DeferredRendering* m_deferredRendering;
FBORenderTexture* m_multipleRenderTarget;
int m_windowWidth;
int m_windowHeight;
HGLRC m_hrc; // Rendering's context
HDC m_hdc; // Device's context
HWND m_hWnd; // Window's handle
unsigned int m_lastTick;
unsigned char m_state; // 0 - Normal render, 1 - Show render targets
};