First blood

This commit is contained in:
vladislav.khorev committed 2013-01-19 20:02:34 +00:00
1 parent 04f270f322
commit 5720f8322b
250 files changed
+33215

No files matched your search

@@ -0,0 +1,27 @@
#ifndef BACKGROUND_CUBEMAP_H_INCLUDED
#define BACKGROUND_CUBEMAP_H_INCLUDED
#include "include/Render/RenderMisc.h"
#include "include/Utils/Utils.h"
namespace SE
{
class TBackgroundCubemapClass
{
protected:
TTriangleList TriangleList;
public:
cardinal BkgTexId;
TBackgroundCubemapClass();
void Draw();
};
} //namespace SE
#endif
@@ -0,0 +1,17 @@
#ifndef SALMON_RENDER_ANDROID_H_INCLUDED
#define SALMON_RENDER_ANDROID_H_INCLUDED
#include "include/Render/SalmonRender/SalmonRenderGLES20.h"
namespace SE
{
class TSalmonRendererAndroid : public TSalmonRendererGLES20
{
};
} //namespace SE
#endif
@@ -0,0 +1,29 @@
#ifndef SALMON_RENDER_GLES20_H_INCLUDED
#define SALMON_RENDER_GLES20_H_INCLUDED
#include "include/Render/SalmonRender/SalmonRenderInterface.h"
#ifdef TARGET_ANDROID
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#endif
namespace SE
{
class TSalmonRendererGLES20 : public TSalmonRendererInterface
{
protected:
virtual void DrawQuad(const T2DQuad& quad);
public:
void DrawTriangleList(const TTriangleList& triangleList);
};
} //namespace SE
#endif
@@ -0,0 +1,86 @@
#ifndef SALMON_RENDER_INTERFACE_H_INCLUDED
#define SALMON_RENDER_INTERFACE_H_INCLUDED
#include "include/Utils/Utils.h"
#include "include/SimpleLand/SimpleLand.h"
#include "include/Render/RenderMisc.h"
#include "include/Render/SalmonRender/BackgroundCubemap.h"
#include "include/Render/RenderInterface.h"
namespace SE
{
class TSalmonRendererInterface : public TRendererInterface
{
protected:
float CamAlpha;
float CamPhi;
float CamDist;
vec3 CamShift;
vec3 CamPos; //Do not change - call CalcCamPosVec instead
vec3 CamVec; //Do not change - call CalcCamPosVec instead
mat4 CamModelViewMatrix;
mat4 CamInversedModelViewMatrix;
float GlobalShadowAreaHalfSize;
void CalcCamPosVec();
virtual void DrawQuad(const T2DQuad& quad) = 0;
public:
TSalmonRendererInterface();
virtual void InitOpenGL(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight);
virtual void SetUniforms();
void SetPerspectiveFullScreenViewport();
void SetOrthoFullScreenViewport();
mat4 GetModelviewMatrix();
void SetPerspectiveProjectionMatrix(float angle, float aspect, float zNear, float zFar);
void PushPerspectiveProjectionMatrix(float angle, float aspect, float zNear, float zFar);
void SetGLCamView();
void SetGlIdentityView();
void SetGlPosXView();
void SetGlNegXView();
void SetGlPosYView();
void SetGlNegYView();
void SetGlPosZView();
void SetGlNegZView();
void MoveAlpha(float dAlpha);
void MovePhi(float dPhi);
void MoveDist(float dDist);
void SetAlpha(float alpha);
vec3 GetCamPos();
void MoveForward();
void MoveBackward();
void MoveLeft();
void MoveRight();
virtual void SwitchToScreen();
virtual void SwitchToFrameBuffer(const std::string& frameName);
void SwitchToCubemapBuffer(const std::string& frameName,cardinal cubeSide);
void BeginDrawToDepthBufferGlobal(std::string& globalBufferName);
void BeginDrawToDepthBufferLocal(std::string& localBufferName);
void EndDrawToDepthBuffer();
};
} //namespace SE
#endif
@@ -0,0 +1,20 @@
#ifndef SALMON_RENDER_IOS_H_INCLUDED
#define SALMON_RENDER_IOS_H_INCLUDED
#include "include/Render/SalmonRender/SalmonRenderGLES20.h"
namespace SE
{
class TSalmonRendererIos : public TSalmonRendererGLES20
{
protected:
public:
};
} //namespace SE
#endif
@@ -0,0 +1,57 @@
#pragma once
/*
This code is the heart of engine. Here is the render and resource manager
*/
#include "include/Utils/Utils.h"
#include "include/SimpleLand/SimpleLand.h"
#include "include/Render/SalmonRender/SalmonRenderInterface.h"
namespace SE
{
class TSalmonRenderer : public TSalmonRendererInterface
{
protected:
bool IsCameraTransparentToLand; //To make it work you must setup LandToCalcCollision
TSimpleLandClass* LandToCalcCollision;
float FogBeginDistance;
float FogEndDistance;
vec4 FogColor;
//Other data:
float ShadowClampValue;
virtual void DrawQuad(const T2DQuad& quad);
public:
TSalmonRenderer();
~TSalmonRenderer();
bool BindOpenGLFunctions();
void SetLandToCalcCollision(TSimpleLandClass* landToCalcCollision);
float GetShadowClampValue();
void SetShadowClampValue(float shadowClampValue);
float GetFogBeginDistance();
float GetFogEndDistance();
vec4 GetFogColor();
void DrawTriangleList(const TTriangleList& triangleList);
};
} //namespace SE