mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Added version class for eepp.
Fixed Pbuffers with shaders. Fixed Map editor scroll when map is scaled. Fixed Point Size in GL3 renderer. Disabled VAO in VBOs.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <eepp/helper/PlusCallback/callback.hpp>
|
||||
|
||||
#include <eepp/declares.hpp>
|
||||
|
||||
#include <eepp/base/base.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#if ( __GNUC__ >= 4 ) && defined( EE_EXPORTS )
|
||||
#if ( __GNUC__ >= 4 )
|
||||
#define EE_API __attribute__ ((visibility("default")))
|
||||
#endif
|
||||
|
||||
@@ -272,22 +272,12 @@ namespace EE {
|
||||
|
||||
template<typename T>
|
||||
T eeclamp( T val, T min, T max ) {
|
||||
if ( val < min ) {
|
||||
return min;
|
||||
} else if ( val > max ) {
|
||||
return max;
|
||||
}
|
||||
|
||||
return val;
|
||||
return ( val < min ) ? min : max;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void eeclamp( T* val, T min, T max ) {
|
||||
if ( *val < min ) {
|
||||
*val = min;
|
||||
} else if ( *val > max ) {
|
||||
*val = max;
|
||||
}
|
||||
( *val < min ) ? *val = min : *val = max;
|
||||
}
|
||||
|
||||
typedef SOPHIST_int8 Int8;
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
*/
|
||||
|
||||
// General includes and declarations
|
||||
#include "base.hpp"
|
||||
#include <eepp/base.hpp>
|
||||
#include <eepp/version.hpp>
|
||||
using namespace EE;
|
||||
|
||||
// Math
|
||||
|
||||
@@ -201,6 +201,8 @@ class EE_API cMap {
|
||||
const eeFloat& Scale() const;
|
||||
|
||||
void Scale( const eeFloat& scale );
|
||||
|
||||
eeVector2i GetMaxOffset();
|
||||
protected:
|
||||
Window::cWindow * mWindow;
|
||||
cLayer** mLayers;
|
||||
@@ -212,7 +214,6 @@ class EE_API cMap {
|
||||
eeSize mTileSize;
|
||||
eeSize mViewSize;
|
||||
eeVector2f mOffset;
|
||||
eeVector2f mFixedOffset;
|
||||
eeVector2i mScreenPos;
|
||||
eeVector2i mStartTile;
|
||||
eeVector2i mEndTile;
|
||||
@@ -261,8 +262,6 @@ class EE_API cMap {
|
||||
void CreateLightManager();
|
||||
|
||||
virtual void OnMapLoaded();
|
||||
|
||||
void UpdateOffscale();
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -118,7 +118,7 @@ class EE_API cMapEditor {
|
||||
|
||||
void OnScrollMapV( const cUIEvent * Event );
|
||||
|
||||
void OnMapSizeChange( const cUIEvent * Event );
|
||||
void OnMapSizeChange( const cUIEvent * Event = NULL );
|
||||
|
||||
void OnLayerSelect( const cUIEvent * Event );
|
||||
|
||||
|
||||
@@ -99,6 +99,8 @@ class EE_API cRendererGL3 : public cGL {
|
||||
GLint Project( GLfloat objx, GLfloat objy, GLfloat objz, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4], GLfloat *winx, GLfloat *winy, GLfloat *winz );
|
||||
|
||||
GLint UnProject( GLfloat winx, GLfloat winy, GLfloat winz, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4], GLfloat *objx, GLfloat *objy, GLfloat *objz );
|
||||
|
||||
void ReloadCurrentShader();
|
||||
protected:
|
||||
Private::cMatrixStack * mStack;
|
||||
GLint mProjectionMatrix_id; // cpu-side hook to shader uniform
|
||||
|
||||
@@ -102,6 +102,8 @@ class EE_API cRendererGLES2 : public cGL {
|
||||
GLint Project( GLfloat objx, GLfloat objy, GLfloat objz, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4], GLfloat *winx, GLfloat *winy, GLfloat *winz );
|
||||
|
||||
GLint UnProject( GLfloat winx, GLfloat winy, GLfloat winz, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4], GLfloat *objx, GLfloat *objy, GLfloat *objz );
|
||||
|
||||
void ReloadCurrentShader();
|
||||
protected:
|
||||
Private::cMatrixStack * mStack;
|
||||
GLint mProjectionMatrix_id; // cpu-side hook to shader uniform
|
||||
|
||||
45
include/eepp/version.hpp
Normal file
45
include/eepp/version.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef EE_VERSION_HPP
|
||||
#define EE_VERSION_HPP
|
||||
|
||||
#include <eepp/declares.hpp>
|
||||
#include <string>
|
||||
|
||||
#define EEPP_MAJOR_VERSION 0
|
||||
#define EEPP_MINOR_VERSION 9
|
||||
#define EEPP_PATCHLEVEL 0
|
||||
|
||||
/** The compiled version of the library */
|
||||
#define EEPP_VERSION(x) \
|
||||
{ \
|
||||
(x)->major = EEPP_MAJOR_VERSION; \
|
||||
(x)->minor = EEPP_MINOR_VERSION; \
|
||||
(x)->patch = EEPP_PATCHLEVEL; \
|
||||
}
|
||||
|
||||
#define EEPP_VERSIONNUM(X, Y, Z) ((X)*1000 + (Y)*100 + (Z))
|
||||
|
||||
#define EEPP_COMPILEDVERSION EEPP_VERSIONNUM(EEPP_MAJOR_VERSION, EEPP_MINOR_VERSION, EEPP_PATCHLEVEL)
|
||||
|
||||
#define EEPP_VERSION_ATLEAST(X, Y, Z) (EEPP_COMPILEDVERSION >= EEPP_VERSIONNUM(X, Y, Z))
|
||||
|
||||
namespace EE {
|
||||
|
||||
class EE_API Version {
|
||||
public:
|
||||
Uint8 major; /**< major version */
|
||||
Uint8 minor; /**< minor version */
|
||||
Uint8 patch; /**< update version */
|
||||
|
||||
/** @return The linked version of the library */
|
||||
static Version GetVersion();
|
||||
|
||||
/** @return The linked version number of the library */
|
||||
static Uint32 GetVersionNum();
|
||||
|
||||
/** @return The library version name: "eepp version major.minor.patch" */
|
||||
static std::string GetVersionName();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by Qt Creator 2.6.0, 2012-12-08T22:45:36. -->
|
||||
<!-- Written by Qt Creator 2.6.0, 2012-12-09T03:29:50. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
@@ -48,7 +48,7 @@
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
|
||||
<value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">{388e5431-b31b-42b3-b9ad-9002d279d75d}</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">3</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
@@ -57,7 +57,7 @@
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets"/>
|
||||
<value type="bool" key="GenericProjectManager.GenericMakeStep.Clean">false</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments">-j4 -e DEBUGBUILD=yes BACKENDS_ALL=yes test</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments">-j4 -e DEBUGBUILD=yes test</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeCommand">make</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
|
||||
@@ -72,7 +72,7 @@
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">-e DEBUGBUILD=yes BACKENDS_ALL=yes clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">-e DEBUGBUILD=yes clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Command">/usr/bin/make</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">clean</value>
|
||||
|
||||
22
src/eepp/base/version.cpp
Normal file
22
src/eepp/base/version.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <eepp/version.hpp>
|
||||
#include <eepp/base/string.hpp>
|
||||
|
||||
namespace EE {
|
||||
|
||||
Version Version::GetVersion() {
|
||||
Version ver;
|
||||
EEPP_VERSION(&ver);
|
||||
return ver;
|
||||
}
|
||||
|
||||
Uint32 Version::GetVersionNum() {
|
||||
Version ver = GetVersion();
|
||||
return EEPP_VERSIONNUM(ver.major, ver.minor, ver.patch);
|
||||
}
|
||||
|
||||
std::string Version::GetVersionName() {
|
||||
Version ver = GetVersion();
|
||||
return String::StrFormated( "eepp version %d.%d.%d", ver.major, ver.minor, ver.patch );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -211,7 +211,7 @@ void cMap::Draw() {
|
||||
|
||||
GLi->LoadIdentity();
|
||||
GLi->PushMatrix();
|
||||
GLi->Translatef( (eeFloat)static_cast<Int32>( mScreenPos.x + mFixedOffset.x ), (eeFloat)static_cast<Int32>( mScreenPos.y + mFixedOffset.y ), 0 );
|
||||
GLi->Translatef( (eeFloat)static_cast<Int32>( mScreenPos.x + mOffset.x ), (eeFloat)static_cast<Int32>( mScreenPos.y + mOffset.y ), 0 );
|
||||
GLi->Scalef( mScale, mScale, 0 );
|
||||
|
||||
GridDraw();
|
||||
@@ -297,7 +297,7 @@ const bool& cMap::IsMouseOver() const {
|
||||
void cMap::GetMouseOverTile() {
|
||||
eeVector2i mouse = mWindow->GetInput()->GetMousePos();
|
||||
|
||||
eeVector2i MapPos( static_cast<eeFloat>( mouse.x - mScreenPos.x - mFixedOffset.x ) / mScale, static_cast<eeFloat>( mouse.y - mScreenPos.y - mFixedOffset.y ) / mScale );
|
||||
eeVector2i MapPos( static_cast<eeFloat>( mouse.x - mScreenPos.x - mOffset.x ) / mScale, static_cast<eeFloat>( mouse.y - mScreenPos.y - mOffset.y ) / mScale );
|
||||
|
||||
mMouseOver = !( MapPos.x < 0 || MapPos.y < 0 || MapPos.x > mPixelSize.x || MapPos.y > mPixelSize.y );
|
||||
|
||||
@@ -320,7 +320,7 @@ void cMap::GetMouseOverTile() {
|
||||
|
||||
void cMap::CalcTilesClip() {
|
||||
if ( mTileSize.x > 0 && mTileSize.y > 0 ) {
|
||||
eeVector2f ffoff( mFixedOffset );
|
||||
eeVector2f ffoff( mOffset );
|
||||
eeVector2i foff( (Int32)ffoff.x, (Int32)ffoff.y );
|
||||
|
||||
mStartTile.x = -foff.x / ( mTileSize.x * mScale ) - mExtraTiles.x;
|
||||
@@ -353,7 +353,7 @@ void cMap::Clamp() {
|
||||
if ( mOffset.y > 0 )
|
||||
mOffset.y = 0;
|
||||
|
||||
eeSize totSize( mTileSize * mSize );
|
||||
eeVector2f totSize( mTileSize.x * mSize.x * mScale, mTileSize.y * mSize.y * mScale );
|
||||
|
||||
if ( -mOffset.x + mViewSize.x > totSize.x )
|
||||
mOffset.x = -( totSize.x - mViewSize.x );
|
||||
@@ -370,43 +370,35 @@ void cMap::Clamp() {
|
||||
totSize.x = (Int32)( (eeFloat)( mTileSize.x * mSize.x ) * mScale );
|
||||
totSize.y = (Int32)( (eeFloat)( mTileSize.y * mSize.y ) * mScale );
|
||||
|
||||
if ( -mFixedOffset.x + mViewSize.x > totSize.x )
|
||||
mFixedOffset.x = -( totSize.x - mViewSize.x );
|
||||
if ( -mOffset.x + mViewSize.x > totSize.x )
|
||||
mOffset.x = -( totSize.x - mViewSize.x );
|
||||
|
||||
if ( -mFixedOffset.y + mViewSize.y > totSize.y )
|
||||
mFixedOffset.y = -( totSize.y - mViewSize.y );
|
||||
if ( -mOffset.y + mViewSize.y > totSize.y )
|
||||
mOffset.y = -( totSize.y - mViewSize.y );
|
||||
|
||||
if ( totSize.x < mViewSize.x )
|
||||
mFixedOffset.x = 0;
|
||||
mOffset.x = 0;
|
||||
|
||||
if ( totSize.y < mViewSize.y )
|
||||
mFixedOffset.y = 0;
|
||||
mOffset.y = 0;
|
||||
}
|
||||
|
||||
void cMap::Offset( const eeVector2f& offset ) {
|
||||
mOffset = offset;
|
||||
mFixedOffset = mOffset * mOffscale;
|
||||
|
||||
Clamp();
|
||||
|
||||
CalcTilesClip();
|
||||
}
|
||||
|
||||
void cMap::UpdateOffscale() {
|
||||
eeVector2f totSizeT( mTileSize.x * mSize.x - mViewSize.x , mTileSize.y * mSize.y - mViewSize.y );
|
||||
eeVector2f totSizeS( mTileSize.x * mSize.x * mScale - mViewSize.x , mTileSize.y * mSize.y * mScale - mViewSize.y );
|
||||
eeVector2i cMap::GetMaxOffset() {
|
||||
eeVector2i v( ( mTileSize.x * mSize.x * mScale ) - mViewSize.x,
|
||||
( mTileSize.y * mSize.y * mScale ) - mViewSize.y );
|
||||
|
||||
if ( 0 == totSizeT.x ) {
|
||||
mOffscale.x = 0;
|
||||
} else {
|
||||
mOffscale.x = totSizeS.x / totSizeT.x;
|
||||
}
|
||||
eemax( 0, v.x );
|
||||
eemax( 0, v.y );
|
||||
|
||||
if ( 0 == totSizeT.y ) {
|
||||
mOffscale.y = 0;
|
||||
} else {
|
||||
mOffscale.y = totSizeS.y / totSizeT.y;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
const eeFloat& cMap::Scale() const {
|
||||
@@ -416,8 +408,6 @@ const eeFloat& cMap::Scale() const {
|
||||
void cMap::Scale( const eeFloat& scale ) {
|
||||
mScale = scale;
|
||||
|
||||
UpdateOffscale();
|
||||
|
||||
Offset( mOffset );
|
||||
}
|
||||
|
||||
@@ -467,8 +457,6 @@ eeVector2f cMap::GetMouseMapPosf() const {
|
||||
void cMap::ViewSize( const eeSize& viewSize ) {
|
||||
mViewSize = viewSize;
|
||||
|
||||
UpdateOffscale();
|
||||
|
||||
Clamp();
|
||||
|
||||
CalcTilesClip();
|
||||
|
||||
@@ -33,19 +33,18 @@ namespace EE { namespace Gaming { namespace MapEditor {
|
||||
|
||||
cMapEditor::cMapEditor( cUIWindow * AttatchTo, const MapEditorCloseCb& callback ) :
|
||||
mUIWindow( AttatchTo ),
|
||||
mTheme( cUIThemeManager::instance()->DefaultTheme() ),
|
||||
mUIMap( NULL ),
|
||||
mCloseCb( callback ),
|
||||
mGOTypeList( NULL ),
|
||||
mChkAnim( NULL ),
|
||||
mCurLayer( NULL )
|
||||
{
|
||||
if ( NULL == cUIThemeManager::instance()->DefaultTheme() ) {
|
||||
if ( NULL == mTheme ) {
|
||||
eePRINT( "cMapEditor needs a default theme seted to work." );
|
||||
return;
|
||||
}
|
||||
|
||||
mTheme = cUIThemeManager::instance()->DefaultTheme();
|
||||
|
||||
if ( NULL == mUIWindow ) {
|
||||
mUIWindow = cUIManager::instance()->MainControl();
|
||||
}
|
||||
@@ -363,11 +362,7 @@ void cMapEditor::CreateUIMap() {
|
||||
cUIComplexControl::CreateParams Params;
|
||||
Params.Parent( mWinContainer );
|
||||
Params.PosSet( 0, 0 );
|
||||
|
||||
if ( mWinContainer->Size().Width() > 800 && mWinContainer->Size().Height() > 600 )
|
||||
Params.SizeSet( 800, 600 );
|
||||
else
|
||||
Params.SizeSet( mWinContainer->Size().Width() - 220, mWinContainer->Size().Height() - 16 );
|
||||
Params.SizeSet( mWinContainer->Size().Width() - 220, mWinContainer->Size().Height() - 16 );
|
||||
|
||||
Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT;
|
||||
mUIMap = eeNew( cUIMap, ( Params ) );
|
||||
@@ -695,12 +690,14 @@ void cMapEditor::MapCreated() {
|
||||
}
|
||||
|
||||
void cMapEditor::OnMapSizeChange( const cUIEvent *Event ) {
|
||||
eeVector2i v( mUIMap->Map()->GetMaxOffset() );
|
||||
|
||||
mMapHScroll->MinValue( 0 );
|
||||
mMapHScroll->MaxValue( mUIMap->Map()->TotalSize().Width() - mUIMap->Size().Width() );
|
||||
mMapHScroll->ClickStep( mUIMap->Map()->TileSize().Width() );
|
||||
mMapHScroll->MaxValue( v.x );
|
||||
mMapHScroll->ClickStep( mUIMap->Map()->TileSize().Width() * mUIMap->Map()->Scale() );
|
||||
mMapVScroll->MinValue( 0 );
|
||||
mMapVScroll->MaxValue( mUIMap->Map()->TotalSize().Height() - mUIMap->Size().Height() );
|
||||
mMapVScroll->ClickStep( mUIMap->Map()->TileSize().Height() );
|
||||
mMapVScroll->MaxValue( v.y );
|
||||
mMapVScroll->ClickStep( mUIMap->Map()->TileSize().Height() * mUIMap->Map()->Scale() );
|
||||
}
|
||||
|
||||
void cMapEditor::OnScrollMapH( const cUIEvent * Event ) {
|
||||
@@ -848,6 +845,8 @@ void cMapEditor::ZoomIn() {
|
||||
Map->Scale( 4.0f );
|
||||
}
|
||||
}
|
||||
|
||||
OnMapSizeChange();
|
||||
}
|
||||
|
||||
void cMapEditor::ZoomOut() {
|
||||
@@ -875,6 +874,8 @@ void cMapEditor::ZoomOut() {
|
||||
Map->Scale( 3.0f );
|
||||
}
|
||||
}
|
||||
|
||||
OnMapSizeChange();
|
||||
}
|
||||
|
||||
void cMapEditor::MapMenuClick( const cUIEvent * Event ) {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include <eepp/graphics/cframebufferpbuffer.hpp>
|
||||
#include <eepp/graphics/ctexturefactory.hpp>
|
||||
#include <eepp/window/cengine.hpp>
|
||||
|
||||
#include <eepp/graphics/renderer/cgl.hpp>
|
||||
#include <eepp/graphics/renderer/crenderergl3.hpp>
|
||||
#include <eepp/graphics/renderer/crenderergles2.hpp>
|
||||
|
||||
#ifdef EE_GLEW_AVAILABLE
|
||||
|
||||
@@ -267,7 +269,18 @@ void cFrameBufferPBuffer::Bind() {
|
||||
#endif
|
||||
|
||||
if ( ChangeContext ) {
|
||||
#ifdef EE_GL3_ENABLED
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
GLi->GetRendererGL3()->ReloadCurrentShader();
|
||||
}
|
||||
|
||||
if ( GLv_ES2 == GLi->Version() ) {
|
||||
GLi->GetRendererGLES2()->ReloadCurrentShader();
|
||||
}
|
||||
#endif
|
||||
|
||||
mWindow->Setup2D( true );
|
||||
|
||||
SetBufferView();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
#include <eepp/graphics/renderer/cgl.hpp>
|
||||
#include <eepp/graphics/renderer/crenderergl3.hpp>
|
||||
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
// Disabled VAO for the moment, we really don't need them
|
||||
//#define EE_VBO_USE_VAO
|
||||
#endif
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
cVertexBufferVBO::cVertexBufferVBO( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) :
|
||||
@@ -25,7 +30,7 @@ cVertexBufferVBO::~cVertexBufferVBO() {
|
||||
glDeleteBuffersARB( 1, (GLuint *)&mElementHandle );
|
||||
}
|
||||
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
#ifdef EE_VBO_USE_VAO
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
glDeleteVertexArrays( 1, &mVAO );
|
||||
}
|
||||
@@ -47,7 +52,7 @@ bool cVertexBufferVBO::Compile() {
|
||||
if( mCompiled )
|
||||
return false;
|
||||
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
#ifdef EE_VBO_USE_VAO
|
||||
GLint curVAO = 0;
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &curVAO );
|
||||
@@ -91,7 +96,7 @@ bool cVertexBufferVBO::Compile() {
|
||||
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, 0 );
|
||||
}
|
||||
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
#ifdef EE_VBO_USE_VAO
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
glBindVertexArray( curVAO );
|
||||
}
|
||||
@@ -107,11 +112,11 @@ void cVertexBufferVBO::Draw() {
|
||||
if ( !mCompiled )
|
||||
return;
|
||||
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
#ifdef EE_VBO_USE_VAO
|
||||
GLint curVAO = 0;
|
||||
#endif
|
||||
if ( GLv_3 == GLi->Version() || GLv_ES2 == GLi->Version() ) {
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
#ifdef EE_VBO_USE_VAO
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &curVAO );
|
||||
glBindVertexArray( mVAO );
|
||||
@@ -138,7 +143,7 @@ void cVertexBufferVBO::Draw() {
|
||||
glDrawArrays( mDrawType, 0, GetVertexCount() );
|
||||
}
|
||||
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
#ifdef EE_VBO_USE_VAO
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
glBindVertexArray( curVAO );
|
||||
}
|
||||
@@ -156,7 +161,7 @@ void cVertexBufferVBO::SetVertexStates() {
|
||||
GLint index;
|
||||
#endif
|
||||
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
#ifdef EE_VBO_USE_VAO
|
||||
GLint curVAO = 0;
|
||||
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
@@ -275,7 +280,7 @@ void cVertexBufferVBO::SetVertexStates() {
|
||||
|
||||
glBindBufferARB( GL_ARRAY_BUFFER, 0 );
|
||||
|
||||
#if !defined( EE_GLES ) && EE_PLATFORM != EE_PLATFORM_HAIKU
|
||||
#ifdef EE_VBO_USE_VAO
|
||||
if ( GLv_3 == GLi->Version() ) {
|
||||
glBindVertexArray( curVAO );
|
||||
}
|
||||
|
||||
@@ -60,6 +60,8 @@ cRendererGL3::cRendererGL3() :
|
||||
{
|
||||
mStack->mProjectionMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix
|
||||
mStack->mModelViewMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix
|
||||
|
||||
cGL::Enable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
}
|
||||
|
||||
cRendererGL3::~cRendererGL3() {
|
||||
@@ -125,6 +127,10 @@ GLuint cRendererGL3::BaseShaderId() {
|
||||
return mCurShader->Handler();
|
||||
}
|
||||
|
||||
void cRendererGL3::ReloadCurrentShader() {
|
||||
ReloadShader( mCurShader );
|
||||
}
|
||||
|
||||
void cRendererGL3::ReloadShader( cShaderProgram * Shader ) {
|
||||
mCurShader = NULL;
|
||||
|
||||
@@ -242,8 +248,6 @@ void cRendererGL3::Enable( GLenum cap ) {
|
||||
{
|
||||
mCurShader->SetUniform( mPointSpriteLoc, 1 );
|
||||
|
||||
cGL::Enable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -286,8 +290,6 @@ void cRendererGL3::Disable ( GLenum cap ) {
|
||||
{
|
||||
mCurShader->SetUniform( mPointSpriteLoc, 0 );
|
||||
|
||||
cGL::Disable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,6 +163,10 @@ GLuint cRendererGLES2::BaseShaderId() {
|
||||
return mCurShader->Handler();
|
||||
}
|
||||
|
||||
void cRendererGLES2::ReloadCurrentShader() {
|
||||
ReloadShader( mCurShader );
|
||||
}
|
||||
|
||||
void cRendererGLES2::ReloadShader( cShaderProgram * Shader ) {
|
||||
mCurShader = NULL;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <eepp/graphics/cglobalbatchrenderer.hpp>
|
||||
|
||||
#include <eepp/system/filesystem.hpp>
|
||||
#include <eepp/version.hpp>
|
||||
|
||||
#include <eepp/helper/SOIL2/src/SOIL2/SOIL2.h>
|
||||
|
||||
@@ -375,7 +376,8 @@ void cWindow::SendVideoResizeCb() {
|
||||
}
|
||||
|
||||
void cWindow::LogSuccessfulInit( const std::string& BackendName ) {
|
||||
cLog::instance()->Write( "Engine Initialized Succesfully.\n\tOS: " + Sys::GetOSName() +
|
||||
cLog::instance()->Write( "Engine Initialized Succesfully.\n\tVersion: " + Version::GetVersionName() +
|
||||
"\n\tOS: " + Sys::GetOSName() +
|
||||
"\n\tArch: " + Sys::GetOSArchitecture() +
|
||||
"\n\tCPU Cores: " + String::ToStr( Sys::GetCPUCount() ) +
|
||||
"\n\tProcess Path: " + Sys::GetProcessPath() +
|
||||
|
||||
Reference in New Issue
Block a user