- Modified the windows project to use SDL as DLL, so that we all get mouse support now.
- I think I fixed issue 664, it's funny how the problem is visible on Windows and on some HTC devices but totally absent on Linux and some Samsung devices - The SDL fullscreen is not working that good, it would need to be improved.
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
@@ -86,6 +86,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@@ -99,7 +100,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
@@ -113,6 +114,7 @@
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@@ -126,7 +128,7 @@
|
||||
<ClCompile>
|
||||
<Optimization>Full</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
@@ -141,6 +143,7 @@
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@@ -152,6 +155,7 @@
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Dependencies\SDL\src\main\windows\SDL_windows_main.c" />
|
||||
<ClCompile Include="src\Encoding.cpp" />
|
||||
<ClCompile Include="src\JAnimator.cpp" />
|
||||
<ClCompile Include="src\JApp.cpp">
|
||||
@@ -276,6 +280,7 @@
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\JTTFont.cpp" />
|
||||
<ClCompile Include="src\SDLmain.cpp" />
|
||||
<ClCompile Include="src\Vector2D.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -288,7 +293,6 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\winmain.cpp" />
|
||||
<ClCompile Include="src\hge\hgecolor.cpp" />
|
||||
<ClCompile Include="src\hge\hgedistort.cpp" />
|
||||
<ClCompile Include="src\hge\hgefont.cpp" />
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
#include <SDL_opengles.h>
|
||||
#else
|
||||
#include <SDL_opengl.h>
|
||||
#ifdef WIN32
|
||||
#undef GL_VERSION_2_0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "../include/JGE.h"
|
||||
#include "../include/JTypes.h"
|
||||
#include "../include/JApp.h"
|
||||
@@ -50,8 +54,11 @@ class SdlApp {
|
||||
|
||||
SDL_Event Event;
|
||||
|
||||
while(Running && SDL_WaitEventTimeout(&Event, 50)) {
|
||||
OnEvent(&Event);
|
||||
while(Running) {
|
||||
while(SDL_WaitEventTimeout(&Event, 0)) {
|
||||
OnEvent(&Event);
|
||||
}
|
||||
OnUpdate();
|
||||
}
|
||||
|
||||
OnCleanup();
|
||||
@@ -108,7 +115,8 @@ class SdlApp {
|
||||
void OnMouseClicked(const SDL_MouseButtonEvent& event);
|
||||
void OnMouseMoved(const SDL_MouseMotionEvent& event);
|
||||
void OnEvent(SDL_Event* Event) {
|
||||
if(Event->type < SDL_USEREVENT) DebugTrace("Event received" << Event->type);
|
||||
/* if(Event->type < SDL_USEREVENT)
|
||||
DebugTrace("Event received" << Event->type);*/
|
||||
switch(Event->type){
|
||||
case SDL_QUIT:
|
||||
{
|
||||
@@ -178,7 +186,6 @@ class SdlApp {
|
||||
}
|
||||
}
|
||||
void OnUpdate();
|
||||
void OnRender();
|
||||
void OnCleanup() {
|
||||
SDL_FreeSurface(Surf_Display);
|
||||
SDL_Quit();
|
||||
@@ -260,14 +267,6 @@ void DestroyGame(void)
|
||||
g_engine = NULL;
|
||||
}
|
||||
|
||||
Uint32 OnTimer( Uint32 interval )
|
||||
{
|
||||
SDL_Event event;
|
||||
event.user.type = WAGIC_UPDATE_EVENT;
|
||||
SDL_PushEvent(&event);
|
||||
return 30;
|
||||
}
|
||||
|
||||
void SdlApp::OnUpdate() {
|
||||
static int tickCount;
|
||||
Uint32 dt;
|
||||
@@ -288,7 +287,10 @@ void SdlApp::OnUpdate() {
|
||||
cerr << oor.what();
|
||||
}
|
||||
|
||||
OnRender();
|
||||
if(g_engine)
|
||||
g_engine->Render();
|
||||
|
||||
SDL_GL_SwapBuffers();
|
||||
}
|
||||
|
||||
void SdlApp::OnKeyPressed(const SDL_KeyboardEvent& event)
|
||||
@@ -483,21 +485,10 @@ bool SdlApp::OnInit() {
|
||||
|
||||
JGECreateDefaultBindings();
|
||||
|
||||
SDL_SetTimer(30, OnTimer);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
void SdlApp::OnRender() {
|
||||
|
||||
if(g_engine)
|
||||
g_engine->Render();
|
||||
|
||||
SDL_GL_SwapBuffers();
|
||||
};
|
||||
|
||||
|
||||
#if (defined ANDROID)
|
||||
#if (defined ANDROID) || (defined WIN32)
|
||||
int SDL_main(int argc, char * argv[])
|
||||
#else
|
||||
int main(int argc, char* argv[])
|
||||
|
||||
Reference in New Issue
Block a user