Cleaned up a little bit the code,to include stl only when is needed.

Reduced compilation time because of this.
Moved SOIL to src, api not exposed anymore.
Renamed the demos and examples namespaces.
This commit is contained in:
spartanj@gmail.com
2012-11-27 01:16:26 -03:00
parent 723553a1be
commit 93ae458174
54 changed files with 146 additions and 93 deletions

View File

@@ -4,6 +4,7 @@
#include <eepp/audio/base.hpp>
#include <eepp/audio/caudioresource.hpp>
#include <eepp/audio/csoundfile.hpp>
#include <set>
namespace EE { namespace Audio {

View File

@@ -1,33 +1,6 @@
#ifndef EE_BASE_HPP
#define EE_BASE_HPP
#undef M_E
#undef M_PI
#undef INFINITY
#include <cstdlib>
#include <climits>
#include <cmath>
#include <cstdarg>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <iostream>
#include <fstream>
#include <sstream>
#include <memory>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <deque>
#include <set>
#include <stack>
#include <eepp/helper/PlusCallback/callback.hpp>
#include <eepp/declares.hpp>

View File

@@ -2,6 +2,7 @@
#define EE_ALLOCATOR_HPP
#include <eepp/base/memorymanager.hpp>
#include <cstddef>
namespace EE {

View File

@@ -6,6 +6,5 @@
#include <eepp/base/debug.hpp>
#include <eepp/base/memorymanager.hpp>
#include <eepp/base/allocator.hpp>
#include <eepp/base/stlcontainers.hpp>
#endif

View File

@@ -3,6 +3,7 @@
#include <eepp/declares.hpp>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <map>

View File

@@ -2,6 +2,9 @@
#define EE_STLCONTAINERS_HPP
#include <eepp/base/memorymanager.hpp>
#include <stack>
#include <set>
#include <deque>
namespace EE {
template <typename T, typename A = eeAllocator<T> >

View File

@@ -2,6 +2,7 @@
#define EE_DECLARES_HPP
#include <eepp/helper/sophist/sophist.h>
#include <cmath>
#define EE_PLATFORM_WIN 1
#define EE_PLATFORM_LINUX 2

View File

@@ -3,6 +3,7 @@
#include <eepp/gaming/base.hpp>
#include <eepp/gaming/clight.hpp>
#include <list>
namespace EE { namespace Gaming {

View File

@@ -3,6 +3,7 @@
#include <eepp/gaming/clayer.hpp>
#include <eepp/gaming/cgameobject.hpp>
#include <list>
namespace EE { namespace Gaming {

View File

@@ -6,6 +6,7 @@
#include <eepp/window/cinputtextbuffer.hpp>
#include <eepp/graphics/cprimitives.hpp>
#include <eepp/graphics/cfont.hpp>
#include <deque>
using namespace EE::Window;

View File

@@ -2,6 +2,7 @@
#define EECMATH_H
#include <eepp/math/base.hpp>
#include <cmath>
namespace EE { namespace Math {

View File

@@ -2,6 +2,8 @@
#define EE_SYSTEMCIOSTREAMFILE_HPP
#include <eepp/system/ciostream.hpp>
#include <iostream>
#include <fstream>
namespace EE { namespace System {

View File

@@ -3,6 +3,7 @@
#include <eepp/system/base.hpp>
#include <eepp/system/cthread.hpp>
#include <list>
namespace EE { namespace System {

View File

@@ -2,6 +2,7 @@
#define EE_SYSTEMTCONTAINER_HPP
#include <eepp/system/base.hpp>
#include <list>
namespace EE { namespace System {

View File

@@ -2,6 +2,7 @@
#define EE_SYSTEMTRESOURCEMANAGER_HPP
#include <eepp/system/base.hpp>
#include <list>
namespace EE { namespace System {

View File

@@ -6,6 +6,7 @@
#include <eepp/ui/cuimenucheckbox.hpp>
#include <eepp/ui/cuimenusubmenu.hpp>
#include <eepp/ui/cuiseparator.hpp>
#include <deque>
namespace EE { namespace UI {

View File

@@ -3,6 +3,7 @@
#include <eepp/ui/cuicomplexcontrol.hpp>
#include <eepp/ui/cuitab.hpp>
#include <deque>
namespace EE { namespace UI {

View File

@@ -2,6 +2,7 @@
#define EE_UTILSCINTERPOLATION_H
#include <eepp/utils/base.hpp>
#include <vector>
namespace EE { namespace Utils {

View File

@@ -3,6 +3,7 @@
#include <eepp/utils/base.hpp>
#include <eepp/utils/vector2.hpp>
#include <vector>
namespace EE { namespace Utils {

View File

@@ -4,6 +4,7 @@
#include <eepp/utils/triangle2.hpp>
#include <eepp/utils/quad2.hpp>
#include <eepp/utils/rect.hpp>
#include <vector>
namespace EE { namespace Utils {

View File

@@ -2,6 +2,9 @@
#define EE_UTILSCSTRING_H
#include <eepp/utils/base.hpp>
#include <fstream>
#include <sstream>
#include <vector>
namespace EE { namespace Utils {

View File

@@ -3,6 +3,7 @@
#include <eepp/utils/base.hpp>
#include <eepp/utils/safedatapointer.hpp>
#include <vector>
namespace EE { namespace Utils {
/** @return True if the file exists ( false if is a directory, to know if directory exists use IsDirectory ) */

View File

@@ -12,6 +12,8 @@ using namespace EE::Graphics;
#include <eepp/window/ccursor.hpp>
using namespace EE::Window::Cursor;
#include <set>
namespace EE { namespace Window {
class EE_API cCursorManager {

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.6.0, 2012-11-25T02:45:58. -->
<!-- Written by Qt Creator 2.6.0, 2012-11-27T01:08:50. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -57,8 +57,8 @@
<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 SHARED_BACKEND=no test</value>
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeCommand"></value>
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments">-j4 -e DEBUGBUILD=yes SHARED_BACKEND=no BACKENDS_ALL=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>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>

View File

@@ -526,8 +526,6 @@
../../src/eepp/graphics/renderer/shaders/basegl3.vert
../../src/eepp/graphics/renderer/shaders/basegl3.frag
../../src/examples/external_shader/external_shader.cpp
../../Makefile.base
../../Makefile
../../src/eepp/helper/haikuttf/sophist.h
../../src/eepp/helper/haikuttf/hkmutex.hpp
../../src/eepp/helper/haikuttf/hkglyph.hpp
@@ -539,12 +537,6 @@
../../src/eepp/helper/haikuttf/hkglyph.cpp
../../src/eepp/helper/haikuttf/hkfontmanager.cpp
../../src/eepp/helper/haikuttf/hkfont.cpp
../../src/eepp/helper/SOIL/stbi_DDS_c.h
../../src/eepp/helper/SOIL/stb_image_write.c
../../src/eepp/helper/SOIL/stb_image.c
../../src/eepp/helper/SOIL/image_helper.c
../../src/eepp/helper/SOIL/image_DXT.c
../../src/eepp/helper/SOIL/SOIL.c
../../include/eepp/window.hpp
../../include/eepp/utils.hpp
../../include/eepp/ui.hpp

View File

@@ -126,17 +126,16 @@
../../include/eepp/graphics/vbohelper.hpp
../../include/eepp/graphics/renders.hpp
../../include/eepp/graphics/pixelperfect.hpp
../../include/eepp/graphics/packerhelper.hpp
../../include/eepp/graphics/glhelper.hpp
../../include/eepp/graphics/fonthelper.hpp
../../include/eepp/graphics/cvertexbuffervbo.hpp
../../include/eepp/graphics/cvertexbufferogl.hpp
../../include/eepp/graphics/cvertexbuffermanager.hpp
../../src/eepp/graphics/cvertexbuffermanager.hpp
../../include/eepp/graphics/cvertexbuffer.hpp
../../include/eepp/graphics/cttffontloader.hpp
../../include/eepp/graphics/cttffont.hpp
../../include/eepp/graphics/ctexturepackertex.hpp
../../include/eepp/graphics/ctexturepackernode.hpp
../../src/eepp/graphics/ctexturepackertex.hpp
../../src/eepp/graphics/ctexturepackernode.hpp
../../include/eepp/graphics/ctexturepacker.hpp
../../include/eepp/graphics/ctextureloader.hpp
../../include/eepp/graphics/ctexturegrouploader.hpp
@@ -159,9 +158,7 @@
../../include/eepp/graphics/cimage.hpp
../../include/eepp/graphics/cglobalshapegroup.hpp
../../include/eepp/graphics/cglobalbatchrenderer.hpp
../../include/eepp/graphics/cframebufferpbuffer.hpp
../../include/eepp/graphics/cframebuffermanager.hpp
../../include/eepp/graphics/cframebufferfbo.hpp
../../src/eepp/graphics/cframebuffermanager.hpp
../../include/eepp/graphics/cframebuffer.hpp
../../include/eepp/graphics/cfontmanager.hpp
../../include/eepp/graphics/cfont.hpp
@@ -378,7 +375,6 @@
../../include/eepp/window/ccursormanager.hpp
../../include/eepp/window/ccursor.hpp
../../include/eepp/window/cclipboard.hpp
../../include/eepp/window/cbackend.hpp
../../include/eepp/window/base.hpp
../../src/eepp/window/inputhelper.cpp
../../src/eepp/window/cwindow.cpp
@@ -514,9 +510,6 @@
../../src/examples/empty_window/empty_window.cpp
../../src/test/eetest.hpp
../../src/test/eetest.cpp
../../src/eeiv/capp.hpp
../../src/eeiv/eeiv.cpp
../../src/eeiv/capp.cpp
../../src/eepp/graphics/renderer/shaders/primitive.vert
../../src/eepp/graphics/renderer/shaders/primitive.frag
../../src/eepp/graphics/renderer/shaders/pointsprite.vert
@@ -533,3 +526,46 @@
../../src/eepp/graphics/renderer/shaders/basegl3.vert
../../src/eepp/graphics/renderer/shaders/basegl3.frag
../../src/examples/external_shader/external_shader.cpp
../../src/eepp/helper/haikuttf/sophist.h
../../src/eepp/helper/haikuttf/hkmutex.hpp
../../src/eepp/helper/haikuttf/hkglyph.hpp
../../src/eepp/helper/haikuttf/hkfontmanager.hpp
../../src/eepp/helper/haikuttf/hkfont.hpp
../../src/eepp/helper/haikuttf/hkbase.hpp
../../src/eepp/helper/haikuttf/haikuttf.hpp
../../src/eepp/helper/haikuttf/hkmutex.cpp
../../src/eepp/helper/haikuttf/hkglyph.cpp
../../src/eepp/helper/haikuttf/hkfontmanager.cpp
../../src/eepp/helper/haikuttf/hkfont.cpp
../../include/eepp/window.hpp
../../include/eepp/utils.hpp
../../include/eepp/ui.hpp
../../include/eepp/system.hpp
../../include/eepp/physics.hpp
../../include/eepp/math.hpp
../../include/eepp/graphics.hpp
../../include/eepp/gaming.hpp
../../include/eepp/ee.hpp
../../include/eepp/declares.hpp
../../include/eepp/base.hpp
../../include/eepp/audio.hpp
../../src/eepp/window/backend/SFML/cwindowsfml.hpp
../../src/eepp/window/backend/SFML/cjoysticksfml.hpp
../../src/eepp/window/backend/SFML/cjoystickmanagersfml.hpp
../../src/eepp/window/backend/SFML/cinputsfml.hpp
../../src/eepp/window/backend/SFML/ccursorsfml.hpp
../../src/eepp/window/backend/SFML/ccursormanagersfml.hpp
../../src/eepp/window/backend/SFML/cclipboardsfml.hpp
../../src/eepp/window/backend/SFML/cbackendsfml.hpp
../../src/eepp/window/backend/SFML/cwindowsfml.cpp
../../src/eepp/window/backend/SFML/cjoysticksfml.cpp
../../src/eepp/window/backend/SFML/cjoystickmanagersfml.cpp
../../src/eepp/window/backend/SFML/cinputsfml.cpp
../../src/eepp/window/backend/SFML/ccursorsfml.cpp
../../src/eepp/window/backend/SFML/ccursormanagersfml.cpp
../../src/eepp/window/backend/SFML/cclipboardsfml.cpp
../../src/eepp/window/cbackend.hpp
../../src/eepp/graphics/cframebufferpbuffer.hpp
../../src/eepp/graphics/cframebufferfbo.hpp
../../src/eepp/graphics/renderer/rendererhelper.hpp
../../include/eepp/graphics/packerhelper.hpp

View File

@@ -2,6 +2,7 @@
#include <eepp/audio/csound.hpp>
#include <eepp/audio/caudiodevice.hpp>
#include <eepp/system/cpackmanager.hpp>
#include <memory>
namespace EE { namespace Audio {

View File

@@ -1,5 +1,6 @@
#include <eepp/audio/openal.hpp>
#include <eepp/audio/caudiodevice.hpp>
#include <iostream>
namespace EE { namespace Audio {

View File

@@ -1,5 +1,8 @@
#include <eepp/base/debug.hpp>
#include <eepp/system/clog.hpp>
#include <cassert>
#include <cstdarg>
using namespace EE::System;
#ifdef EE_COMPILER_MSVC

View File

@@ -25,6 +25,8 @@
#include <eepp/graphics/cglobalshapegroup.hpp>
#include <eepp/graphics/ctexturegrouploader.hpp>
#include <algorithm>
using namespace EE::Graphics;
namespace EE { namespace Gaming { namespace MapEditor {

View File

@@ -4,6 +4,8 @@
#include <eepp/window/cinput.hpp>
#include <eepp/window/cengine.hpp>
#include <eepp/window/ccursormanager.hpp>
#include <algorithm>
#include <cstdarg>
using namespace EE::Window;

View File

@@ -250,7 +250,7 @@ void cTextureFactory::SetPreBlendFunc( const EE_PRE_BLEND_FUNC& blend, bool forc
GLi->BlendFunc(GL_DST_COLOR,GL_ZERO);
break;
case ALPHA_NONE:
// AVOID COMPILER WARNING
// Avoid compiler warning
break;
case ALPHA_CUSTOM:
break;

View File

@@ -4,6 +4,7 @@
#include <eepp/graphics/ctexturepackernode.hpp>
#include <eepp/graphics/ctexturepackertex.hpp>
#include <eepp/helper/SOIL/stb_image.h>
#include <algorithm>
namespace EE { namespace Graphics {

View File

@@ -5,6 +5,7 @@
#ifdef EE_GL3_ENABLED
#include <stack>
#include <eepp/helper/glm/gtx/transform.hpp>
namespace EE { namespace Graphics { namespace Private {

View File

@@ -3,6 +3,7 @@
#include <eepp/physics/cshape.hpp>
#include <eepp/physics/cspace.hpp>
#include <eepp/physics/constraints/cconstraint.hpp>
#include <algorithm>
CP_NAMESPACE_BEGIN

View File

@@ -3,6 +3,7 @@
#include <eepp/system/cpackmanager.hpp>
#include <eepp/system/ciostreamfile.hpp>
#include <eepp/system/ciostreammemory.hpp>
#include <cstdarg>
namespace EE { namespace System {

View File

@@ -1,4 +1,5 @@
#include <eepp/system/clog.hpp>
#include <cstdarg>
namespace EE { namespace System {

View File

@@ -1,5 +1,6 @@
#include <eepp/system/platform/posix/cthreadimpl.hpp>
#include <eepp/system/cthread.hpp>
#include <iostream>
namespace EE { namespace System { namespace Platform {

View File

@@ -1,5 +1,6 @@
#include <eepp/system/platform/win/cthreadimpl.hpp>
#include <eepp/system/cthread.hpp>
#include <iostream>
namespace EE { namespace System { namespace Platform {

View File

@@ -2,6 +2,7 @@
#include <eepp/ui/cuimanager.hpp>
#include <eepp/ui/cuilistboxitem.hpp>
#include <eepp/ui/cuithememanager.hpp>
#include <algorithm>
namespace EE { namespace UI {

View File

@@ -1,5 +1,6 @@
#include <eepp/ui/cuimanager.hpp>
#include <eepp/window/cengine.hpp>
#include <algorithm>
namespace EE { namespace UI {

View File

@@ -5,6 +5,7 @@
#include <eepp/ui/cuimenuitem.hpp>
#include <eepp/ui/cuicommondialog.hpp>
#include <eepp/ui/cuimessagebox.hpp>
#include <algorithm>
namespace EE { namespace UI { namespace Tools {

View File

@@ -1,5 +1,7 @@
#include <cctype>
#include <eepp/utils/string.hpp>
#include <algorithm>
#include <cstdarg>
namespace EE { namespace Utils {

View File

@@ -6,6 +6,8 @@ using namespace EE::System;
#include <sys/stat.h>
#if defined( EE_PLATFORM_POSIX )
#include <sys/utsname.h>
#if EE_PLATFORM != EE_PLATFORM_ANDROID
#include <sys/statvfs.h>
#else
@@ -35,9 +37,6 @@ using namespace EE::System;
#if EE_PLATFORM == EE_PLATFORM_WIN
#include <direct.h>
#endif
#if EE_PLATFORM == EE_PLATFORM_WIN
#include <sys/utime.h>
#else
#include <sys/time.h>
@@ -51,7 +50,7 @@ using namespace EE::System;
#endif
#endif
static bool TickStarted = false;
namespace EE { namespace Utils {
#if EE_PLATFORM == EE_PLATFORM_WIN
@@ -215,10 +214,6 @@ static LARGE_INTEGER hires_ticks_per_second;
#endif
#if defined( EE_PLATFORM_POSIX )
#include <sys/utsname.h>
#endif
#ifdef EE_PLATFORM_POSIX
#ifdef EE_HAVE_CLOCK_GETTIME
@@ -229,8 +224,6 @@ static struct timeval start;
#endif
namespace EE { namespace Utils {
std::string GetOSName() {
#if defined( EE_PLATFORM_POSIX )
struct utsname os;
@@ -269,23 +262,26 @@ bool FileExists( const std::string& Filepath ) {
}
static void eeStartTicks() {
#if EE_PLATFORM == EE_PLATFORM_WIN
QueryPerformanceFrequency(&hires_ticks_per_second);
QueryPerformanceCounter(&hires_start_ticks);
#else
#ifdef EE_HAVE_CLOCK_GETTIME
clock_gettime(CLOCK_MONOTONIC, &start);
#else
gettimeofday(&start, NULL);
#endif
#endif
static bool TickStarted = false;
TickStarted = true;
if ( !TickStarted ) {
#if EE_PLATFORM == EE_PLATFORM_WIN
QueryPerformanceFrequency(&hires_ticks_per_second);
QueryPerformanceCounter(&hires_start_ticks);
#else
#ifdef EE_HAVE_CLOCK_GETTIME
clock_gettime(CLOCK_MONOTONIC, &start);
#else
gettimeofday(&start, NULL);
#endif
#endif
TickStarted = true;
}
}
Uint32 eeGetTicks() {
if ( !TickStarted )
eeStartTicks();
eeStartTicks();
#if EE_PLATFORM == EE_PLATFORM_WIN
LARGE_INTEGER hires_now;

View File

@@ -11,12 +11,25 @@
#include <eepp/window/platform/platformimpl.hpp>
#if EE_PLATFORM == EE_PLATFORM_WIN
#include <allegro5/allegro_windows.h>
#define WGL_NV_video_out
#include <allegro5/allegro_windows.h>
#define WGL_NV_video_out
#elif defined( EE_X11_PLATFORM )
#include <allegro5/platform/aintuthr.h>
#include <allegro5/internal/aintern_system.h>
#endif
#include <allegro5/platform/aintuthr.h>
#include <allegro5/allegro_opengl.h>
#include <allegro5/internal/aintern_system.h>
#include <allegro5/internal/aintern_thread.h>
#include <eepp/window/backend/allegro5/cclipboardal.hpp>
#include <eepp/window/backend/allegro5/cinputal.hpp>
#include <eepp/window/backend/allegro5/ccursormanageral.hpp>
#include <eepp/helper/SOIL/stb_image.h>
namespace EE { namespace Window { namespace Backend { namespace Al {
#if defined( EE_X11_PLATFORM )
struct ALLEGRO_SYSTEM_XGLX
{
@@ -61,7 +74,7 @@ struct ALLEGRO_SYSTEM_XGLX
struct ALLEGRO_DISPLAY_XGLX
{
ALLEGRO_DISPLAY display;
Window window;
::Window window;
int xscreen;
int adapter;
GLXWindow glxwindow;
@@ -81,6 +94,7 @@ struct ALLEGRO_DISPLAY_XGLX
int x, y;
bool mouse_warp;
};
static _AL_MUTEX * al_display_mutex = NULL;
static void al_display_lock() {
@@ -97,16 +111,6 @@ static void al_display_unlock() {
#endif
#include <allegro5/allegro_opengl.h>
#include <allegro5/internal/aintern_system.h>
#include <allegro5/internal/aintern_thread.h>
#include <eepp/window/backend/allegro5/cclipboardal.hpp>
#include <eepp/window/backend/allegro5/cinputal.hpp>
#include <eepp/window/backend/allegro5/ccursormanageral.hpp>
namespace EE { namespace Window { namespace Backend { namespace Al {
cWindowAl::cWindowAl( WindowSettings Settings, ContextSettings Context ) :
cWindow( Settings, Context, eeNew( cClipboardAl, ( this ) ), eeNew( cInputAl, ( this ) ), eeNew( cCursorManagerAl, ( this ) ) ),
mDisplay( NULL ),

View File

@@ -1,6 +1,8 @@
#include <eepp/ee.hpp>
/// This example is based on the WebGL demo from http://minimal.be/lab/fluGL/
namespace Demo_ExternalShader {
Uint32 ParticlesNum = 30000;
cWindow * win = NULL;
cShaderProgram * ShaderProgram = NULL;
@@ -76,6 +78,9 @@ void videoResize() {
}
}
}
using namespace Demo_ExternalShader;
EE_MAIN_FUNC int main (int argc, char * argv [])
{
win = cEngine::instance()->CreateWindow( WindowSettings( 960, 640, 32, WindowStyle::Default, "", "eepp - External Shaders" ), ContextSettings( true ) );

View File

@@ -1,6 +1,6 @@
#include "eetest.hpp"
namespace EE { namespace Demo {
namespace Demo_Test {
void cEETest::Init() {
EE = cEngine::instance();
@@ -1916,10 +1916,10 @@ void cEETest::End() {
cEngine::DestroySingleton();
}
}}
}
EE_MAIN_FUNC int main (int argc, char * argv []) {
EE::Demo::cEETest * Test = eeNew( EE::Demo::cEETest, () );
Demo_Test::cEETest * Test = eeNew( Demo_Test::cEETest, () );
Test->Process();

View File

@@ -3,7 +3,7 @@
#include <eepp/ee.hpp>
namespace EE { namespace Demo {
namespace Demo_Test {
class cUITest : public cUIControlAnim {
public:
@@ -305,6 +305,6 @@ class cEETest : private cThread {
void OnShowMenu( const cUIEvent * Event );
};
}}
}
#endif