8 #include "ClipmapView.h"
77 bool createIcoSphere(
float radius,
float section,
int levels,
VoxelFarm::CCellData::CVert* verts,
int& vertCount, GLushort* faceIndices,
int& faceCount);
82 void recomputeShadows();
129 extern GLuint cloudTextureId;
void clearDisplacementMaps()
Clear the created displacement maps.
int window_width
Width of the main window.
bool bake(CClipmapView *clipmapView, StatTracker &stats)
Moves multiple Cells from main memory into GPU memory.
bool IsExtensionSupported(char *szTargetExtension)
Determines whether the specified OpenGL extension is supported.
void loadShaders()
Initializes GLSL shaders.
Contains all classes and functions for the VoxelFarm engine.
Contains all materials available in the system.
GLuint shadowFBOId
FBO Id for the Sunlight shadow.
void orthogonalStart()
Starts orthogonal projection.
void generateSkylightFBO()
Initializes FBO for Sunlight shadows.
const int ERROR_SHUTDOWN_FAILED
Engine shutdown failed.
void OnBeforeRender()
Prototype for BeforeRender event. This event fires before rendering begins.
void setShadowTextureMatrix(GLuint textureSlot=GL_TEXTURE7)
Computes and stores the Sunlight shadow matrix.
GLuint shadowFBOIdPhysics
FBO Id for the Sunlight shadow for physics fragments.
bool loadMaterials(CMaterialLibrary *materialLibrary, char *path, bool loadCompressed)
Load material definitions and textures into main memory and GPU memory.
int window_height
Height of the main window.
void setSkylightTextureMatrix()
Computes and stores the Skylight shadow matrix.
GLuint skylightFBOId
FBO Id for the Skylight shadow.
void OnAfterRender()
Prototype for AfterRender event. This event fires after the world scene is rendered.
int skylightMapWidth
Shadowmap Width for the Skylight shadow.
const int ERROR_RESOLUTION_NOT_SUPPORTED
Video resolution is not supported.
GLvoid KillGLWindow()
Destroys the main window.
int shadowMapWidth
Shadowmap Width for the Sunlight shadow.
const int ERROR_INITIALIZATION_FAILED
Engine shutdown failed.
const int ERROR_SHADER
Shader error.
void bakeCell(CClipmapView *clipmapView, CGLCellData *cellData)
Moves the specified Cell data from main memory into GPU memory.
HDC hDC
HDC object for the main window.
BOOL CreateGLWindow(char *title, int width, int height, int bits, bool fullscreenflag, WNDPROC WndProc, bool hosted, HWND parent)
Creates the main window.
int skylightMapHeight
Shadowmap Height for the Skylight shadow.
int DrawGLScene(CClipmapView *clipmapView)
Draws the scene to screen.
bool fullscreen
Signals whether the application is full screen.
A CellData object for rendering in OpenGL.
HWND hWnd
Handle for the main window.
GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
Resizes the GL context.
Represents a moving view within a world. Computes new scenes as the view moves.
void disposeDeadCells(CClipmapView *clipmapView, int iterations)
Disposes a specified number of inactive cells, removing them from GPU memory.
const int MATERIAL_PROPERTY_COUNT
Number of properties in each material defintion inside the GPU material array.
RGBImageRec * loadImg(const char *szName)
Load a BMP image.
An object to track stats. Contains two different counters.
HGLRC hRC
HRC object for the main window.
int InitGL(GLvoid)
Initializes OpenGL.
void orthogonalEnd()
Ends orthogonal projection.
int shadowMapHeight
Shadowmap Height for the Sunlight shadow.
OnBeforeRender * afterRender
Pointer to AfterRender event. This event fires after the world scene is rendered. ...
OnBeforeRender * beforeRender
Pointer to BeforeRender event. This event fires before rendering begins.
HINSTANCE hInstance
HINSTANCE object for the main window.
void generateShadowFBO()
Initializes FBO for Sunlight shadows.