mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Replaced EE_DYNAMIC for EE_STATIC, so now you need to specify that you are using
eepp as a static library, since the majority of the people will use the dynamic it seems logic to use dynamic by default. Removed all the EE_MAIN_FUNC and "main" func hacks, except the android and ios ones that can't be removed ( i probably broke something here, it's a WIP. Fixed Android compilation. Added eepp-main.
This commit is contained in:
@@ -10,7 +10,7 @@ cGL * GLi = NULL;
|
||||
cGL * cGL::ms_singleton = NULL;
|
||||
|
||||
cGL * cGL::CreateSingleton( EEGL_version ver ) {
|
||||
#ifdef EE_PLATFORM_DESKTOP
|
||||
#if !defined( EE_GLES1 ) && !defined( EE_GLES2 )
|
||||
if ( GLv_default == ver )
|
||||
ver = GLv_2;
|
||||
#else
|
||||
|
||||
13
src/eepp/main/eepp_main.cpp
Normal file
13
src/eepp/main/eepp_main.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
extern int main(int argc, char* argv[]);
|
||||
|
||||
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT)
|
||||
{
|
||||
return main(__argc, __argv);
|
||||
}
|
||||
|
||||
#endif // _WIN32
|
||||
@@ -29,7 +29,7 @@ void cUIPopUpMenu::SetTheme( cUITheme * Theme ) {
|
||||
bool cUIPopUpMenu::Show() {
|
||||
if ( !Visible() || 0.f == mAlpha ) {
|
||||
#ifdef EE_PLATFORM_TOUCH
|
||||
mTE.Reset();
|
||||
mTE.Restart();
|
||||
#endif
|
||||
|
||||
Enabled( true );
|
||||
@@ -86,7 +86,7 @@ Uint32 cUIPopUpMenu::OnMessage( const cUIMessage * Msg ) {
|
||||
case cUIMessage::MsgMouseUp:
|
||||
{
|
||||
#ifdef EE_PLATFORM_TOUCH
|
||||
if ( mTE.Elapsed() > 250.f ) {
|
||||
if ( mTE.Elapsed().AsMilliseconds() > 250.f ) {
|
||||
#endif
|
||||
if ( !Msg->Sender()->IsType( UI_TYPE_MENUSUBMENU ) && ( Msg->Flags() & EE_BUTTONS_LRM ) ) {
|
||||
SendCommonEvent( cUIEvent::EventOnHideByClick );
|
||||
|
||||
@@ -64,6 +64,10 @@ static std::string SDL_AndroidGetApkPath() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM )
|
||||
#define SDL2_THREADED_GLCONTEXT
|
||||
#endif
|
||||
|
||||
namespace EE { namespace Window { namespace Backend { namespace SDL2 {
|
||||
|
||||
cWindowSDL::cWindowSDL( WindowSettings Settings, ContextSettings Context ) :
|
||||
@@ -205,7 +209,7 @@ bool cWindowSDL::Create( WindowSettings Settings, ContextSettings Context ) {
|
||||
}*/
|
||||
#endif
|
||||
|
||||
#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM )
|
||||
#ifdef SDL2_THREADED_GLCONTEXT
|
||||
SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1 );
|
||||
|
||||
mGLContext = SDL_GL_CreateContext( mSDLWindow );
|
||||
@@ -215,7 +219,7 @@ bool cWindowSDL::Create( WindowSettings Settings, ContextSettings Context ) {
|
||||
#endif
|
||||
|
||||
if ( NULL == mGLContext
|
||||
#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM )
|
||||
#ifdef SDL2_THREADED_GLCONTEXT
|
||||
|| NULL == mGLContextThread
|
||||
#endif
|
||||
)
|
||||
@@ -279,7 +283,11 @@ bool cWindowSDL::Create( WindowSettings Settings, ContextSettings Context ) {
|
||||
}
|
||||
|
||||
bool cWindowSDL::IsThreadedGLContext() {
|
||||
#ifdef SDL2_THREADED_GLCONTEXT
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void cWindowSDL::SetGLContextThread() {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
// EE_MAIN_FUNC is needed for some platforms to export the main function as C function.
|
||||
EE_MAIN_FUNC int main (int argc, char * argv [])
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
// Create a new window
|
||||
cWindow * win = cEngine::instance()->CreateWindow( WindowSettings( 960, 640, "eepp - Empty Window" ) );
|
||||
|
||||
@@ -81,7 +81,7 @@ void videoResize( cWindow * w ) {
|
||||
}
|
||||
using namespace Demo_ExternalShader;
|
||||
|
||||
EE_MAIN_FUNC int main (int argc, char * argv [])
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
win = cEngine::instance()->CreateWindow( WindowSettings( 960, 640, "eepp - External Shaders" ), ContextSettings( true ) );
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
EE_MAIN_FUNC int main (int argc, char * argv [])
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
// Create a new window
|
||||
cWindow * win = cEngine::instance()->CreateWindow( WindowSettings( 960, 640, "eepp - Fonts" ), ContextSettings( true ) );
|
||||
|
||||
@@ -608,7 +608,7 @@ void PhysicsDestroy() {
|
||||
mDemo[ mCurDemo ].destroy();
|
||||
}
|
||||
|
||||
EE_MAIN_FUNC int main (int argc, char * argv [])
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
mWindow = cEngine::instance()->CreateWindow( WindowSettings( 1024, 768, "eepp - Physics" ), ContextSettings( true ) );
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void playMusic() {
|
||||
}
|
||||
|
||||
/// Entry point of application
|
||||
EE_MAIN_FUNC int main (int argc, char * argv [])
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
// Play a sound
|
||||
playSound();
|
||||
|
||||
@@ -26,7 +26,7 @@ void spriteCallback( Uint32 Event, cSprite * Sprite, void * UserData ) {
|
||||
}
|
||||
}
|
||||
|
||||
EE_MAIN_FUNC int main (int argc, char * argv [])
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
// Create a new window
|
||||
cWindow * win = cEngine::instance()->CreateWindow( WindowSettings( 640, 480, "eepp - Sprites" ), ContextSettings( true ) );
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <eepp/ee.hpp>
|
||||
|
||||
// EE_MAIN_FUNC is needed for some platforms to export the main function as C function.
|
||||
EE_MAIN_FUNC int main (int argc, char * argv [])
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
// Create a new window
|
||||
cWindow * win = cEngine::instance()->CreateWindow( WindowSettings( 1024, 768, "eepp - VBO - FBO and Batch Rendering" ), ContextSettings( true ) );
|
||||
|
||||
@@ -1945,7 +1945,7 @@ void cEETest::End() {
|
||||
|
||||
}
|
||||
|
||||
EE_MAIN_FUNC int main (int argc, char * argv []) {
|
||||
int main (int argc, char * argv []) {
|
||||
Demo_Test::cEETest * Test = eeNew( Demo_Test::cEETest, () );
|
||||
|
||||
Test->Process();
|
||||
|
||||
Reference in New Issue
Block a user