|
From: <cn...@us...> - 2009-07-10 02:52:19
|
Revision: 419
http://hgengine.svn.sourceforge.net/hgengine/?rev=419&view=rev
Author: cnlohr
Date: 2009-07-10 02:52:18 +0000 (Fri, 10 Jul 2009)
Log Message:
-----------
update Windows project and fix operation on Windows.
Modified Paths:
--------------
Mercury2/Mercury2.vcproj
Mercury2/src/MercuryNamedResource.cpp
Mercury2/src/OGLExtensions.cpp
Mercury2/src/OGLExtensions.h
Mercury2/src/Shader.cpp
Mercury2/src/Win32Window.cpp
Modified: Mercury2/Mercury2.vcproj
===================================================================
--- Mercury2/Mercury2.vcproj 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/Mercury2.vcproj 2009-07-10 02:52:18 UTC (rev 419)
@@ -6,7 +6,6 @@
ProjectGUID="{071CC088-86A7-4A9F-9FEE-50BD69132886}"
RootNamespace="Mercury2"
Keyword="Win32Proj"
- TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@@ -66,8 +65,6 @@
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -89,6 +86,9 @@
Name="VCAppVerifierTool"
/>
<Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -142,8 +142,6 @@
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -165,6 +163,9 @@
Name="VCAppVerifierTool"
/>
<Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -190,10 +191,6 @@
>
</File>
<File
- RelativePath=".\src\Camera.h"
- >
- </File>
- <File
RelativePath=".\src\Frustum.cpp"
>
</File>
@@ -202,10 +199,6 @@
>
</File>
<File
- RelativePath=".\src\FullscreenQuad.h"
- >
- </File>
- <File
RelativePath=".\src\GLHelpers.cpp"
>
</File>
@@ -278,6 +271,10 @@
>
</File>
<File
+ RelativePath=".\src\MercuryNamedResource.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryNode.cpp"
>
</File>
@@ -290,10 +287,18 @@
>
</File>
<File
+ RelativePath=".\src\MercuryPrefs.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryString.cpp"
>
</File>
<File
+ RelativePath=".\src\MercuryTheme.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryThreads.cpp"
>
</File>
@@ -322,10 +327,6 @@
>
</File>
<File
- RelativePath=".\src\ModuleManager.h"
- >
- </File>
- <File
RelativePath=".\src\MQuaternion.cpp"
>
</File>
@@ -400,10 +401,18 @@
>
</File>
<File
+ RelativePath=".\src\Camera.h"
+ >
+ </File>
+ <File
RelativePath=".\src\Frustum.h"
>
</File>
<File
+ RelativePath=".\src\FullscreenQuad.h"
+ >
+ </File>
+ <File
RelativePath=".\src\glext.h"
>
</File>
@@ -496,6 +505,10 @@
>
</File>
<File
+ RelativePath=".\src\MercuryNamedResource.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryNode.h"
>
</File>
@@ -508,10 +521,18 @@
>
</File>
<File
+ RelativePath=".\src\MercuryPrefs.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryString.h"
>
</File>
<File
+ RelativePath=".\src\MercuryTheme.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryThreads.h"
>
</File>
@@ -548,6 +569,10 @@
>
</File>
<File
+ RelativePath=".\src\ModuleManager.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MQuaternion.h"
>
</File>
Modified: Mercury2/src/MercuryNamedResource.cpp
===================================================================
--- Mercury2/src/MercuryNamedResource.cpp 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/MercuryNamedResource.cpp 2009-07-10 02:52:18 UTC (rev 419)
@@ -1,7 +1,7 @@
#include <MercuryNamedResource.h>
#include <MercuryUtil.h>
+#include <stdio.h>
-
MString MercuryNamedResource::GetValueS( const MString & sDataPointer )
{
MString ret;
@@ -35,7 +35,11 @@
void MercuryNamedResource::SetValueF( const MString & sDataPointer, float fValue )
{
char sset[64];
+#ifdef WIN32
+ _snprintf_s( sset, 63, "%f", fValue );
+#else
snprintf( sset, 63, "%f", fValue );
+#endif
SetValueS( sDataPointer, sset );
}
@@ -83,7 +87,11 @@
void MercuryNamedResource::SetValueI( const MString & sDataPointer, int iValue )
{
char sset[64];
+#ifdef WIN32
+ _snprintf_s( sset, 63, "%d", iValue );
+#else
snprintf( sset, 63, "%d", iValue );
+#endif
SetValueS( sDataPointer, sset );
}
Modified: Mercury2/src/OGLExtensions.cpp
===================================================================
--- Mercury2/src/OGLExtensions.cpp 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/OGLExtensions.cpp 2009-07-10 02:52:18 UTC (rev 419)
@@ -47,6 +47,12 @@
PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
+PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
+PFNGLGENQUERIESARBPROC glGenQueriesARB;
+PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
+PFNGLBEGINQUERYARBPROC glBeginQueryARB;
+PFNGLENDQUERYARBPROC glEndQueryARB;
+
#define EXTENSION( proc, name ) \
name = (proc)wglGetProcAddress( #name ); \
if( !name ) \
@@ -96,4 +102,11 @@
EXTENSION( PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT );
EXTENSION( PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC, glCheckFramebufferStatusEXT );
EXTENSION( PFNGLDRAWBUFFERSARBPROC, glDrawBuffersARB );
+
+
+EXTENSION( PFNGLDELETEQUERIESARBPROC, glDeleteQueriesARB );
+EXTENSION( PFNGLGENQUERIESARBPROC, glGenQueriesARB );
+EXTENSION( PFNGLGETQUERYOBJECTUIVARBPROC, glGetQueryObjectuivARB );
+EXTENSION( PFNGLBEGINQUERYARBPROC, glBeginQueryARB );
+EXTENSION( PFNGLENDQUERYARBPROC, glEndQueryARB );
}
Modified: Mercury2/src/OGLExtensions.h
===================================================================
--- Mercury2/src/OGLExtensions.h 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/OGLExtensions.h 2009-07-10 02:52:18 UTC (rev 419)
@@ -41,6 +41,13 @@
extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
+
+extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
+extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
+extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
+extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
+extern PFNGLENDQUERYARBPROC glEndQueryARB;
+
void SetupOGLExtensions();
#endif
\ No newline at end of file
Modified: Mercury2/src/Shader.cpp
===================================================================
--- Mercury2/src/Shader.cpp 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/Shader.cpp 2009-07-10 02:52:18 UTC (rev 419)
@@ -6,7 +6,9 @@
#include <string.h>
//Because we need to dynamically check for glProgramParameteriEXT, even in Linux.
+#ifndef WIN32
#include <GL/glx.h>
+#endif
using namespace std;
Modified: Mercury2/src/Win32Window.cpp
===================================================================
--- Mercury2/src/Win32Window.cpp 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/Win32Window.cpp 2009-07-10 02:52:18 UTC (rev 419)
@@ -116,6 +116,8 @@
ShowWindow(m_hwnd,SW_SHOW);
SetForegroundWindow(m_hwnd); // Slightly Higher Priority
SetFocus(m_hwnd); // Sets Keyboard Focus To The Window
+
+
}
void Win32Window::SetPixelType()
@@ -175,6 +177,12 @@
bool Win32Window::SwapBuffers()
{
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_NORMALIZE);
+ glEnable (GL_BLEND);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
return (::SwapBuffers( m_hdc )==TRUE);
}
@@ -184,14 +192,35 @@
while (PeekMessage(&message, NULL, 0, 0, PM_REMOVE))
{
- // Stop Update if the user is trying to quit
- if (message.message == WM_QUIT)
+ switch( message.message )
+ {
+ case WM_QUIT:
return false;
- else
- {
- TranslateMessage(&message); // Translate The Message
- DispatchMessage(&message); // Dispatch The Message
+ case WM_KEYDOWN:
+ printf( "%d\n", message.lParam>>16 );
+ break;
+ case WM_KEYUP:
+ break;
+ case WM_MOUSEMOVE:
+ break;
+ case WM_LBUTTONDOWN:
+ break;
+ case WM_LBUTTONUP:
+ break;
+ case WM_RBUTTONDOWN:
+ break;
+ case WM_RBUTTONUP:
+ break;
+ case WM_MBUTTONDOWN:
+ break;
+ case WM_MBUTTONUP:
+ break;
+ case 0x020A: //Do nothing (at least now) It's a mouse wheel!
+ break;
}
+
+ TranslateMessage(&message); // Translate The Message
+ DispatchMessage(&message); // Dispatch The Message
}
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|