From: <axl...@us...> - 2009-05-11 23:45:32
|
Revision: 220 http://hgengine.svn.sourceforge.net/hgengine/?rev=220&view=rev Author: axlecrusher Date: 2009-05-11 23:45:21 +0000 (Mon, 11 May 2009) Log Message: ----------- Work on windows compile Modified Paths: -------------- Mercury2/Mercury2.sln Mercury2/Mercury2.vcproj Mercury2/src/AlignedBuffer.h Mercury2/src/BoundingBox.cpp Mercury2/src/BoundingBox.h Mercury2/src/MAutoPtr.h Mercury2/src/MSemaphore.cpp Mercury2/src/MSemaphore.h Mercury2/src/MercuryFileDriverDirect.cpp Mercury2/src/MercuryMath.cpp Mercury2/src/MercuryMessageManager.h Mercury2/src/MercuryTimer.cpp Mercury2/src/MercuryTimer.h Mercury2/src/MercuryUtil.cpp Mercury2/src/MercuryUtil.h Mercury2/src/MercuryVBO.cpp Mercury2/src/MercuryVertex.cpp Mercury2/src/MercuryVertex.h Mercury2/src/MercuryWindow.h Mercury2/src/MessageHandler.h Mercury2/src/PNGLoader.cpp Mercury2/src/Quad.cpp Mercury2/src/RenderGraph.cpp Mercury2/src/RenderableNode.cpp Mercury2/src/RenderableNode.h Mercury2/src/Shader.cpp Mercury2/src/Texture.cpp Mercury2/src/Texture.h Mercury2/src/TransformNode.cpp Mercury2/src/Viewport.cpp Mercury2/src/Win32Window.cpp Mercury2/src/Win32Window.h Added Paths: ----------- Mercury2/freeglut.dll Mercury2/freeglut.lib Mercury2/iconv.dll Mercury2/libpng.lib Mercury2/libpng3.dll Mercury2/libxml2.dll Mercury2/libxml2.lib Mercury2/src/GLHeaders.h Mercury2/src/Mint.h Mercury2/src/glext.h Mercury2/src/global.h Mercury2/src/include/ Mercury2/src/include/freeglut/ Mercury2/src/include/freeglut/freeglut.h Mercury2/src/include/freeglut/freeglut_ext.h Mercury2/src/include/freeglut/freeglut_std.h Mercury2/src/include/freeglut/glut.h Mercury2/src/include/iconv.h Mercury2/src/include/libxml/ Mercury2/src/include/libxml/DOCBparser.h Mercury2/src/include/libxml/HTMLparser.h Mercury2/src/include/libxml/HTMLtree.h Mercury2/src/include/libxml/SAX.h Mercury2/src/include/libxml/SAX2.h Mercury2/src/include/libxml/c14n.h Mercury2/src/include/libxml/catalog.h Mercury2/src/include/libxml/chvalid.h Mercury2/src/include/libxml/debugXML.h Mercury2/src/include/libxml/dict.h Mercury2/src/include/libxml/encoding.h Mercury2/src/include/libxml/entities.h Mercury2/src/include/libxml/globals.h Mercury2/src/include/libxml/hash.h Mercury2/src/include/libxml/list.h Mercury2/src/include/libxml/nanoftp.h Mercury2/src/include/libxml/nanohttp.h Mercury2/src/include/libxml/parser.h Mercury2/src/include/libxml/parserInternals.h Mercury2/src/include/libxml/pattern.h Mercury2/src/include/libxml/relaxng.h Mercury2/src/include/libxml/schemasInternals.h Mercury2/src/include/libxml/schematron.h Mercury2/src/include/libxml/threads.h Mercury2/src/include/libxml/tree.h Mercury2/src/include/libxml/uri.h Mercury2/src/include/libxml/valid.h Mercury2/src/include/libxml/xinclude.h Mercury2/src/include/libxml/xlink.h Mercury2/src/include/libxml/xmlIO.h Mercury2/src/include/libxml/xmlautomata.h Mercury2/src/include/libxml/xmlerror.h Mercury2/src/include/libxml/xmlexports.h Mercury2/src/include/libxml/xmlmemory.h Mercury2/src/include/libxml/xmlmodule.h Mercury2/src/include/libxml/xmlreader.h Mercury2/src/include/libxml/xmlregexp.h Mercury2/src/include/libxml/xmlsave.h Mercury2/src/include/libxml/xmlschemas.h Mercury2/src/include/libxml/xmlschemastypes.h Mercury2/src/include/libxml/xmlstring.h Mercury2/src/include/libxml/xmlunicode.h Mercury2/src/include/libxml/xmlversion.h Mercury2/src/include/libxml/xmlwin32version.h Mercury2/src/include/libxml/xmlwriter.h Mercury2/src/include/libxml/xpath.h Mercury2/src/include/libxml/xpathInternals.h Mercury2/src/include/libxml/xpointer.h Mercury2/src/include/png/ Mercury2/src/include/png/libpng12/ Mercury2/src/include/png/libpng12/png.h Mercury2/src/include/png/libpng12/pngconf.h Mercury2/src/include/png/png.h Mercury2/src/include/png/pngconf.h Mercury2/src/include/zlib/ Mercury2/src/include/zlib/zconf.h Mercury2/src/include/zlib/zlib.h Mercury2/zdll.lib Modified: Mercury2/Mercury2.sln =================================================================== --- Mercury2/Mercury2.sln 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/Mercury2.sln 2009-05-11 23:45:21 UTC (rev 220) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mercury2", "Mercury2.vcproj", "{071CC088-86A7-4A9F-9FEE-50BD69132886}" EndProject Global Modified: Mercury2/Mercury2.vcproj =================================================================== --- Mercury2/Mercury2.vcproj 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/Mercury2.vcproj 2009-05-11 23:45:21 UTC (rev 220) @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="8.00" + Version="9.00" Name="Mercury2" ProjectGUID="{071CC088-86A7-4A9F-9FEE-50BD69132886}" RootNamespace="Mercury2" Keyword="Win32Proj" + TargetFrameworkVersion="131072" > <Platforms> <Platform @@ -40,8 +41,8 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="src/" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + AdditionalIncludeDirectories="src/;src/include;src/include/zlib;src/include/png;src/include/libxml2;src/include/freeglut" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HGENGINE" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -61,10 +62,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="opengl32.lib" + AdditionalDependencies="zdll.lib libpng.lib libxml2.lib opengl32.lib" LinkIncremental="2" GenerateDebugInformation="true" SubSystem="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> <Tool @@ -86,9 +89,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> @@ -142,6 +142,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> <Tool @@ -163,9 +165,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> @@ -179,10 +178,58 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File + RelativePath=".\src\BMPLoader.cpp" + > + </File> + <File + RelativePath=".\src\BoundingBox.cpp" + > + </File> + <File + RelativePath=".\src\Frustum.cpp" + > + </File> + <File + RelativePath=".\src\HGMDLMesh.cpp" + > + </File> + <File + RelativePath=".\src\HGMDLModel.cpp" + > + </File> + <File + RelativePath=".\src\ImageLoader.cpp" + > + </File> + <File RelativePath=".\src\Mercury2.cpp" > </File> <File + RelativePath=".\src\MercuryAsset.cpp" + > + </File> + <File + RelativePath=".\src\MercuryFile.cpp" + > + </File> + <File + RelativePath=".\src\MercuryFileDriverDirect.cpp" + > + </File> + <File + RelativePath=".\src\MercuryFileDriverMem.cpp" + > + </File> + <File + RelativePath=".\src\MercuryFileDriverPacked.cpp" + > + </File> + <File + RelativePath=".\src\MercuryFileDriverZipped.cpp" + > + </File> + <File RelativePath=".\src\MercuryMath.cpp" > </File> @@ -191,17 +238,101 @@ > </File> <File + RelativePath=".\src\MercuryMessageManager.cpp" + > + </File> + <File + RelativePath=".\src\MercuryNode.cpp" + > + </File> + <File + RelativePath=".\src\MercuryPlane.cpp" + > + </File> + <File + RelativePath=".\src\MercuryPoint.cpp" + > + </File> + <File + RelativePath=".\src\MercuryString.cpp" + > + </File> + <File RelativePath=".\src\MercuryThreads.cpp" > </File> <File + RelativePath=".\src\MercuryTimer.cpp" + > + </File> + <File + RelativePath=".\src\MercuryUtil.cpp" + > + </File> + <File + RelativePath=".\src\MercuryVBO.cpp" + > + </File> + <File + RelativePath=".\src\MercuryVertex.cpp" + > + </File> + <File RelativePath=".\src\MercuryWindow.cpp" > </File> <File + RelativePath=".\src\MSemaphore.cpp" + > + </File> + <File + RelativePath=".\src\PNGLoader.cpp" + > + </File> + <File + RelativePath=".\src\Quad.cpp" + > + </File> + <File + RelativePath=".\src\RawImageData.cpp" + > + </File> + <File + RelativePath=".\src\RenderableNode.cpp" + > + </File> + <File + RelativePath=".\src\RenderGraph.cpp" + > + </File> + <File + RelativePath=".\src\Shader.cpp" + > + </File> + <File + RelativePath=".\src\Texture.cpp" + > + </File> + <File + RelativePath=".\src\TransformNode.cpp" + > + </File> + <File + RelativePath=".\src\UpdateThreader.cpp" + > + </File> + <File + RelativePath=".\src\Viewport.cpp" + > + </File> + <File RelativePath=".\src\Win32Window.cpp" > </File> + <File + RelativePath=".\src\XMLParser.cpp" + > + </File> </Filter> <Filter Name="Header Files" @@ -209,14 +340,86 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File + RelativePath=".\src\AlignedBuffer.h" + > + </File> + <File + RelativePath=".\src\BoundingBox.h" + > + </File> + <File RelativePath=".\src\Callback.h" > </File> <File + RelativePath=".\src\Frustum.h" + > + </File> + <File + RelativePath=".\src\glext.h" + > + </File> + <File + RelativePath=".\src\GLHeaders.h" + > + </File> + <File + RelativePath=".\src\global.h" + > + </File> + <File + RelativePath=".\src\HGMDLMesh.h" + > + </File> + <File + RelativePath=".\src\HGMDLModel.h" + > + </File> + <File + RelativePath=".\src\ImageLoader.h" + > + </File> + <File RelativePath=".\src\MAutoPtr.h" > </File> <File + RelativePath=".\src\MercuryAsset.h" + > + </File> + <File + RelativePath=".\src\MercuryBacktrace.h" + > + </File> + <File + RelativePath=".\src\MercuryCrash.h" + > + </File> + <File + RelativePath=".\src\MercuryFile.h" + > + </File> + <File + RelativePath=".\src\MercuryFileDriverDirect.h" + > + </File> + <File + RelativePath=".\src\MercuryFileDriverMem.h" + > + </File> + <File + RelativePath=".\src\MercuryFileDriverPacked.h" + > + </File> + <File + RelativePath=".\src\MercuryFileDriverZipped.h" + > + </File> + <File + RelativePath=".\src\MercuryList.h" + > + </File> + <File RelativePath=".\src\MercuryMath.h" > </File> @@ -225,25 +428,117 @@ > </File> <File + RelativePath=".\src\MercuryMessageManager.h" + > + </File> + <File + RelativePath=".\src\MercuryNode.h" + > + </File> + <File + RelativePath=".\src\MercuryPlane.h" + > + </File> + <File + RelativePath=".\src\MercuryPoint.h" + > + </File> + <File + RelativePath=".\src\MercuryString.h" + > + </File> + <File RelativePath=".\src\MercuryThreads.h" > </File> <File + RelativePath=".\src\MercuryTimer.h" + > + </File> + <File RelativePath=".\src\MercuryUtil.h" > </File> <File + RelativePath=".\src\MercuryVBO.h" + > + </File> + <File + RelativePath=".\src\MercuryVertex.h" + > + </File> + <File RelativePath=".\src\MercuryWindow.h" > </File> <File + RelativePath=".\src\MessageHandler.h" + > + </File> + <File + RelativePath=".\src\Mint.h" + > + </File> + <File + RelativePath=".\src\MQueue.h" + > + </File> + <File RelativePath=".\src\MScopedArray.h" > </File> <File + RelativePath=".\src\MSemaphore.h" + > + </File> + <File + RelativePath=".\src\PriorityQueue.h" + > + </File> + <File + RelativePath=".\src\Quad.h" + > + </File> + <File + RelativePath=".\src\RawImageData.h" + > + </File> + <File + RelativePath=".\src\RenderableNode.h" + > + </File> + <File + RelativePath=".\src\RenderGraph.h" + > + </File> + <File + RelativePath=".\src\Shader.h" + > + </File> + <File + RelativePath=".\src\Texture.h" + > + </File> + <File + RelativePath=".\src\TransformNode.h" + > + </File> + <File + RelativePath=".\src\UpdateThreader.h" + > + </File> + <File + RelativePath=".\src\Viewport.h" + > + </File> + <File RelativePath=".\src\Win32Window.h" > </File> + <File + RelativePath=".\src\XMLParser.h" + > + </File> </Filter> <Filter Name="Resource Files" Added: Mercury2/freeglut.dll =================================================================== (Binary files differ) Property changes on: Mercury2/freeglut.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: Mercury2/freeglut.lib =================================================================== (Binary files differ) Property changes on: Mercury2/freeglut.lib ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: Mercury2/iconv.dll =================================================================== (Binary files differ) Property changes on: Mercury2/iconv.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: Mercury2/libpng.lib =================================================================== (Binary files differ) Property changes on: Mercury2/libpng.lib ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: Mercury2/libpng3.dll =================================================================== (Binary files differ) Property changes on: Mercury2/libpng3.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: Mercury2/libxml2.dll =================================================================== (Binary files differ) Property changes on: Mercury2/libxml2.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: Mercury2/libxml2.lib =================================================================== (Binary files differ) Property changes on: Mercury2/libxml2.lib ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: Mercury2/src/AlignedBuffer.h =================================================================== --- Mercury2/src/AlignedBuffer.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/AlignedBuffer.h 2009-05-11 23:45:21 UTC (rev 220) @@ -1,7 +1,7 @@ #ifndef ALIGNEDBUFFER_H #define ALIGNEDBUFFER_H -#include <stdint.h> +#include <Mint.h> template <typename T> class AlignedBuffer Modified: Mercury2/src/BoundingBox.cpp =================================================================== --- Mercury2/src/BoundingBox.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/BoundingBox.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -1,5 +1,4 @@ -#include <GL/gl.h> -#include <GL/glext.h> +#include <GLHeaders.h> #include <BoundingBox.h> #include <string.h> #include <Viewport.h> Modified: Mercury2/src/BoundingBox.h =================================================================== --- Mercury2/src/BoundingBox.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/BoundingBox.h 2009-05-11 23:45:21 UTC (rev 220) @@ -5,7 +5,7 @@ #include <MercuryVertex.h> #include <MercuryMatrix.h> #include <Frustum.h> -#include <stdint.h> +#include <Mint.h> #include <MercuryPlane.h> class BoundingVolume Added: Mercury2/src/GLHeaders.h =================================================================== --- Mercury2/src/GLHeaders.h (rev 0) +++ Mercury2/src/GLHeaders.h 2009-05-11 23:45:21 UTC (rev 220) @@ -0,0 +1,18 @@ +#ifndef GLHEADERS_H +#define GLHEADERS_H + +#ifdef WIN32 +#include <windows.h> +#endif + +#include <GL/gl.h> + +#ifdef WIN32 +#include <glext.h> +#else +#include <GL/glext.h> +#endif + +#include <glut.h> + +#endif \ No newline at end of file Modified: Mercury2/src/MAutoPtr.h =================================================================== --- Mercury2/src/MAutoPtr.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MAutoPtr.h 2009-05-11 23:45:21 UTC (rev 220) @@ -2,6 +2,7 @@ #define MAUTOPTR_H #include <MercuryThreads.h> +#include <stdlib.h> class RefBase { Modified: Mercury2/src/MSemaphore.cpp =================================================================== --- Mercury2/src/MSemaphore.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MSemaphore.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -1,94 +1,162 @@ -#include <MSemaphore.h> - -MSemaphore::MSemaphore() - :m_counter(0) -{ -} - -unsigned long MSemaphore::Read() -{ - return __sync_or_and_fetch(&m_counter, 0); -} - -unsigned long MSemaphore::ReadAndClear() -{ - return __sync_fetch_and_and(&m_counter, 0); -} - -unsigned long MSemaphore::Decrement() -{ - return __sync_sub_and_fetch(&m_counter, 1); -} - -unsigned long MSemaphore::Increment() -{ - return __sync_add_and_fetch(&m_counter, 1); -} - -void MSemaphore::WaitAndSet(unsigned long value, unsigned long newVal) -{ - while ( !__sync_bool_compare_and_swap(&m_counter, value, newVal) ); -} - -MSemaphoreLock::MSemaphoreLock(MSemaphore* s) - :m_s(s) -{ - m_s->WaitAndSet(0,1); -} - -MSemaphoreLock::~MSemaphoreLock() -{ - m_s->WaitAndSet(1,0); -} - -MSemaphoreIncOnDestroy::MSemaphoreIncOnDestroy(MSemaphore* s) - :m_s(s) -{ -} - -MSemaphoreIncOnDestroy::~MSemaphoreIncOnDestroy() -{ - m_s->Increment(); -} - -MSemaphoreDecOnDestroy::MSemaphoreDecOnDestroy(MSemaphore* s) - :m_s(s) -{ -} - -MSemaphoreDecOnDestroy::~MSemaphoreDecOnDestroy() -{ - m_s->Decrement(); -} - -/**************************************************************************** - * Copyright (C) 2008 by Joshua Allen * - * * - * * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * * Redistributions in binary form must reproduce the above * - * copyright notice, this list of conditions and the following * - * disclaimer in the documentation and/or other materials provided * - * with the distribution. * - * * Neither the name of the Mercury Engine nor the names of its * - * contributors may be used to endorse or promote products derived * - * from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - ***************************************************************************/ +#include <MSemaphore.h> + +MSemaphore::MSemaphore() + :m_counter(0) +{ +} +#ifndef WIN32 + +unsigned long MSemaphore::Read() +{ + return __sync_or_and_fetch(&m_counter, 0); +} + +unsigned long MSemaphore::ReadAndClear() +{ + return __sync_fetch_and_and(&m_counter, 0); +} + +unsigned long MSemaphore::Decrement() +{ + return __sync_sub_and_fetch(&m_counter, 1); +} + +unsigned long MSemaphore::Increment() +{ + return __sync_add_and_fetch(&m_counter, 1); +} + +void MSemaphore::WaitAndSet(unsigned long value, unsigned long newVal) +{ + while ( !__sync_bool_compare_and_swap(&m_counter, value, newVal) ); +} + +#else + +//These functions seem to be missing from x86 WinBase +FORCEINLINE +LONG +MyInterlockedOr ( + __inout LONG volatile *Destination, + __in LONG Value + ) +{ + LONG Old; + + do { + Old = *Destination; + } while (InterlockedCompareExchange(Destination, + Old | Value, + Old) != Old); + + return Old; +} + +FORCEINLINE +LONG +MyInterlockedAnd ( + __inout LONG volatile *Destination, + __in LONG Value + ) +{ + LONG Old; + + do { + Old = *Destination; + } while (InterlockedCompareExchange(Destination, + Old & Value, + Old) != Old); + + return Old; +} + +unsigned long MSemaphore::Read() +{ + return MyInterlockedOr(&m_counter, 0); +} + +unsigned long MSemaphore::ReadAndClear() +{ + return MyInterlockedAnd(&m_counter, 0); +} + +unsigned long MSemaphore::Decrement() +{ + return InterlockedDecrement(&m_counter); +} + +unsigned long MSemaphore::Increment() +{ + return InterlockedIncrement(&m_counter); +} + +void MSemaphore::WaitAndSet(unsigned long value, unsigned long newVal) +{ + InterlockedCompareExchange(&m_counter, newVal, value); +// while ( !__sync_bool_compare_and_swap(&m_counter, value, newVal) ); +} + +#endif + +MSemaphoreLock::MSemaphoreLock(MSemaphore* s) + :m_s(s) +{ + m_s->WaitAndSet(0,1); +} + +MSemaphoreLock::~MSemaphoreLock() +{ + m_s->WaitAndSet(1,0); +} + +MSemaphoreIncOnDestroy::MSemaphoreIncOnDestroy(MSemaphore* s) + :m_s(s) +{ +} + +MSemaphoreIncOnDestroy::~MSemaphoreIncOnDestroy() +{ + m_s->Increment(); +} + +MSemaphoreDecOnDestroy::MSemaphoreDecOnDestroy(MSemaphore* s) + :m_s(s) +{ +} + +MSemaphoreDecOnDestroy::~MSemaphoreDecOnDestroy() +{ + m_s->Decrement(); +} + +/**************************************************************************** + * Copyright (C) 2008 by Joshua Allen * + * * + * * + * All rights reserved. * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * Redistributions in binary form must reproduce the above * + * copyright notice, this list of conditions and the following * + * disclaimer in the documentation and/or other materials provided * + * with the distribution. * + * * Neither the name of the Mercury Engine nor the names of its * + * contributors may be used to endorse or promote products derived * + * from this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + ***************************************************************************/ Modified: Mercury2/src/MSemaphore.h =================================================================== --- Mercury2/src/MSemaphore.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MSemaphore.h 2009-05-11 23:45:21 UTC (rev 220) @@ -1,6 +1,12 @@ #ifndef MSEMAPHORE_H #define MSEMAPHORE_H +#include <global.h> + +#ifdef WIN32 +#include <windows.h> +#endif + class MSemaphore { public: @@ -13,7 +19,12 @@ void WaitAndSet(unsigned long value, unsigned long newVal); private: - unsigned long m_counter; + +#ifndef WIN32 + int32_t m_counter; +#else + volatile LONG m_counter; +#endif }; class MSemaphoreLock Modified: Mercury2/src/MercuryFileDriverDirect.cpp =================================================================== --- Mercury2/src/MercuryFileDriverDirect.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryFileDriverDirect.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -1,11 +1,13 @@ #include "MercuryFileDriverDirect.h" -#if !defined(WIN32) +#ifndef WIN32 #include <dirent.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> +#else +#include <windows.h> #endif #if defined(_EE) @@ -169,7 +171,7 @@ if( !m_fF ) return 0; #if defined(WIN32) - HANDLE hFile = CreateFile( m_sPath.c_str(), GENERIC_READ, FILE_SHARE_READ, + HANDLE hFile = CreateFile( (LPCWSTR)(m_sPath.c_str()), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if( !hFile ) return 0; @@ -203,7 +205,7 @@ char buffer[1024]; char * path_end; int retcode = 0; - if( ( retcode = GetModuleFileName( NULL, buffer, 1024 ) ) < 0 ) + if( ( retcode = GetModuleFileName( NULL, (LPWCH)buffer, 1024 ) ) < 0 ) { fprintf( stderr, "WARNING: Could not change path of program to path of executable! Faild to get it with response: %d\n", retcode ); } @@ -213,7 +215,7 @@ fprintf( stderr, "WARNING: Could not change path of program to path of executable! Path retreived: \"%s\".\n", buffer ); } *path_end = 0; - if( !SetCurrentDirectory( buffer ) ) + if( !SetCurrentDirectory( (LPCWSTR)buffer ) ) { fprintf( stderr, "WARNING: Could not set operational folder.", buffer ); } @@ -256,7 +258,7 @@ { #if defined(WIN32) WIN32_FIND_DATA fd; - HANDLE hFind = ::FindFirstFile( sPath, &fd ); + HANDLE hFind = ::FindFirstFile( (LPCWSTR)(sPath.c_str()), &fd ); if( INVALID_HANDLE_VALUE == hFind ) // no files found return; do @@ -267,7 +269,7 @@ if( (!bDirsOnly) && (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) continue; // skip - MString sDirName( fd.cFileName ); + MString sDirName( ((char*)fd.cFileName) ); if( sDirName == "." || sDirName == ".." ) continue; Modified: Mercury2/src/MercuryMath.cpp =================================================================== --- Mercury2/src/MercuryMath.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryMath.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -1,4 +1,4 @@ -#include <stdint.h> +#include <Mint.h> #include "MercuryMath.h" //the SSE version of this was really slow, this is quicker Modified: Mercury2/src/MercuryMessageManager.h =================================================================== --- Mercury2/src/MercuryMessageManager.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryMessageManager.h 2009-05-11 23:45:21 UTC (rev 220) @@ -7,7 +7,7 @@ #include <PriorityQueue.h> #include <MercuryString.h> #include <MercuryUtil.h> -#include <stdint.h> +#include <Mint.h> /* This message system uses absolute integer time values to fire off events. This ensures accuarate firing times while eliminating floating point error. Modified: Mercury2/src/MercuryTimer.cpp =================================================================== --- Mercury2/src/MercuryTimer.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryTimer.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -4,14 +4,19 @@ #include <sys/time.h> #else #include <windows.h> + + #endif int64_t GetTimeInMicroSeconds() { +#ifndef WIN32 struct timeval tv; gettimeofday( &tv, 0 ); - return (int64_t(tv.tv_sec) * 1000000) + tv.tv_usec; +#else + return timeGetTime() * uint64_t(1000); +#endif } MercuryTimer::MercuryTimer() Modified: Mercury2/src/MercuryTimer.h =================================================================== --- Mercury2/src/MercuryTimer.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryTimer.h 2009-05-11 23:45:21 UTC (rev 220) @@ -1,7 +1,7 @@ #ifndef MERCURYTIMER_H #define MERCURYTIMER_H -#include <stdint.h> +#include <Mint.h> int64_t GetTimeInMicroSeconds(); Modified: Mercury2/src/MercuryUtil.cpp =================================================================== --- Mercury2/src/MercuryUtil.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryUtil.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -1,6 +1,6 @@ #include <MercuryUtil.h> #include <MercuryFile.h> -#include <stdint.h> +#include <Mint.h> MString ToUpper(const MString& s) { @@ -21,6 +21,12 @@ return x; } +int32_t StrToInt(const MString & s, int32_t d) +{ + int32_t x = d; + if ( s.length() > 0) sscanf(s.c_str(), "%d", &x); + return x; +} void* mmemalign(size_t align, size_t size, void*& mem) { uintptr_t mask = ~(uintptr_t)(align - 1); Modified: Mercury2/src/MercuryUtil.h =================================================================== --- Mercury2/src/MercuryUtil.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryUtil.h 2009-05-11 23:45:21 UTC (rev 220) @@ -4,6 +4,7 @@ #include <stdlib.h> #include <MercuryString.h> #include <assert.h> +#include <global.h> /*#ifndef NULL #define NULL 0 @@ -30,15 +31,16 @@ MString ToUpper(const MString & s); float StrToFloat(const MString & s, float d = 0); +int32_t StrToInt(const MString & s, int32_t d = 0); template<typename T> -const T& max(const T& t1, const T& t2) +const T& MAX(const T& t1, const T& t2) { return t1>t2?t1:t2; } template<typename T> -const T& min(const T& t1, const T& t2) +const T& MIN(const T& t1, const T& t2) { return t1<t2?t1:t2; } Modified: Mercury2/src/MercuryVBO.cpp =================================================================== --- Mercury2/src/MercuryVBO.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryVBO.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -2,9 +2,9 @@ #define GL_GLEXT_PROTOTYPES -#include <GL/gl.h> -#include <GL/glext.h> +#include <GLHeaders.h> + #include <Texture.h> #define BUFFER_OFFSET(i) ((char*)NULL + (i)) @@ -45,7 +45,7 @@ ++m_vboBinds; } - //apply all the active textures + //apply all the active Textures for (uint8_t i = 0; i < numTextures; ++i) { glActiveTexture( GL_TEXTURE0+i ); Modified: Mercury2/src/MercuryVertex.cpp =================================================================== --- Mercury2/src/MercuryVertex.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryVertex.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -51,8 +51,8 @@ float MercuryVertex::GetBiggestElement() const { float tmp = (*this)[0]; - tmp = max<float>(tmp, (*this)[1]); - return max<float>(tmp, (*this)[2]); + tmp = MAX<float>(tmp, (*this)[1]); + return MAX<float>(tmp, (*this)[2]); } const MercuryVertex& MercuryVertex::operator *= (const MercuryVertex& p) Modified: Mercury2/src/MercuryVertex.h =================================================================== --- Mercury2/src/MercuryVertex.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryVertex.h 2009-05-11 23:45:21 UTC (rev 220) @@ -3,7 +3,11 @@ #include <MercuryMath.h> -# define __inline__ __inline__ __attribute__((always_inline)) +#ifndef WIN32 +#define __inline__ __inline__ __attribute__((always_inline)) +#else +#define __inline__ inline +#endif class MercuryVertex { Modified: Mercury2/src/MercuryWindow.h =================================================================== --- Mercury2/src/MercuryWindow.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MercuryWindow.h 2009-05-11 23:45:21 UTC (rev 220) @@ -1,6 +1,7 @@ #ifndef MERCURYWINDOW_H #define MERCURYWINDOW_H +#include <global.h> #include <MercuryUtil.h> #include <list> #include <Callback.h> @@ -36,7 +37,8 @@ static MercuryWindow* m_windowInstance; MString m_title; - int m_width, m_height, m_bits, m_depthBits; + int m_width, m_height; + uint8_t m_bits, m_depthBits; bool m_fullscreen; }; Modified: Mercury2/src/MessageHandler.h =================================================================== --- Mercury2/src/MessageHandler.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/MessageHandler.h 2009-05-11 23:45:21 UTC (rev 220) @@ -2,6 +2,7 @@ #define MESSAGEHANDLER_H #include <MercuryString.h> +#include <global.h> class MessageHandler { Added: Mercury2/src/Mint.h =================================================================== --- Mercury2/src/Mint.h (rev 0) +++ Mercury2/src/Mint.h 2009-05-11 23:45:21 UTC (rev 220) @@ -0,0 +1,17 @@ +#ifndef MINT_H +#define MINT_H + +#ifdef WIN32 +typedef __int8 int8_t; +typedef __int16 int16_t; +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +#else +#include <stdint.h> +#endif + +#endif \ No newline at end of file Modified: Mercury2/src/PNGLoader.cpp =================================================================== --- Mercury2/src/PNGLoader.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/PNGLoader.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -171,4 +171,4 @@ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ + */ \ No newline at end of file Modified: Mercury2/src/Quad.cpp =================================================================== --- Mercury2/src/Quad.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/Quad.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -2,9 +2,9 @@ #define GL_GLEXT_PROTOTYPES -#include <GL/gl.h> -#include <GL/glext.h> +#include <GLHeaders.h> + REGISTER_ASSET_TYPE(Quad); Quad::Quad() Modified: Mercury2/src/RenderGraph.cpp =================================================================== --- Mercury2/src/RenderGraph.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/RenderGraph.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -1,7 +1,7 @@ #include <MercuryMatrix.h> #include <RenderGraph.h> -#include <GL/gl.h> +#include <GLHeaders.h> void RenderGraphEntry::Render() { Modified: Mercury2/src/RenderableNode.cpp =================================================================== --- Mercury2/src/RenderableNode.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/RenderableNode.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -1,8 +1,8 @@ #include <RenderableNode.h> #include <assert.h> -#include <GL/gl.h> +#include <GLHeaders.h> #include <TransformNode.h> -#include <unistd.h> +//#include <unistd.h> #include <Viewport.h> using namespace std; @@ -67,8 +67,11 @@ MercuryNode* n = NULL; TransformNode* tn; for (n = Parent(); n; n = n->Parent()) - if ( (tn = TransformNode::Cast(n)) ) + { + tn = TransformNode::Cast(n); + if ( tn ) return tn->GetGlobalMatrix(); + } return MercuryMatrix::Identity(); } Modified: Mercury2/src/RenderableNode.h =================================================================== --- Mercury2/src/RenderableNode.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/RenderableNode.h 2009-05-11 23:45:21 UTC (rev 220) @@ -6,7 +6,7 @@ #include <MercuryAsset.h> #include <MercuryMatrix.h> #include <MSemaphore.h> -#include <stdint.h> +#include <Mint.h> #define MCHECKASSETS Modified: Mercury2/src/Shader.cpp =================================================================== --- Mercury2/src/Shader.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/Shader.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -4,9 +4,9 @@ #define GL_GLEXT_PROTOTYPES -#include <GL/gl.h> -#include <GL/glext.h> +#include <GLHeaders.h> + #include <string.h> using namespace std; @@ -47,8 +47,8 @@ void Shader::Init(MercuryNode* node) { MercuryAsset::Init( node ); - RenderableNode* rn; - if ( (rn=RenderableNode::Cast( node )) ) + RenderableNode* rn = RenderableNode::Cast( node ); + if ( rn ) rn->AddPostRender( this ); } @@ -84,7 +84,7 @@ void Shader::LoadFromXML(const XMLNode& node) { sShaderName = node.Attribute("file"); - fPriority = atof( node.Attribute("priority").c_str() ); + fPriority = StrToFloat( node.Attribute("priority").c_str() ); LoadShader( ); } Modified: Mercury2/src/Texture.cpp =================================================================== --- Mercury2/src/Texture.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/Texture.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -4,10 +4,7 @@ #define GL_GLEXT_PROTOTYPES -#include <GL/gl.h> -#include <GL/glext.h> -#include <GL/glu.h> - +#include <GLHeaders.h> using namespace std; REGISTER_ASSET_TYPE(Texture); @@ -36,8 +33,8 @@ { MercuryAsset::Init( node ); - RenderableNode* rn; - if ( (rn=RenderableNode::Cast( node )) ) + RenderableNode* rn = RenderableNode::Cast( node ); + if ( rn ) rn->AddPostRender( this ); } @@ -106,7 +103,7 @@ void Texture::LoadFromXML(const XMLNode& node) { - LoadImage( node.Attribute("file") ); + LoadImagePath( node.Attribute("file") ); } void Texture::BindTexture() @@ -131,7 +128,7 @@ --m_activeTextures; } -void Texture::LoadImage(const MString& path) +void Texture::LoadImagePath(const MString& path) { if (m_isInstanced) return; if ( !path.empty() ) @@ -165,12 +162,12 @@ { MAutoPtr< MercuryAsset > t( AssetFactory::GetInstance().Generate("Texture", path) ); Texture *a = (Texture*)t.Ptr(); - a->LoadImage( path ); + a->LoadImagePath( path ); return a; } bool Texture::m_initTextureSuccess = false; -unsigned short Texture::m_activeTextures = 0; +uint8_t Texture::m_activeTextures = 0; uint32_t Texture::m_textureBinds = 0; /*************************************************************************** Modified: Mercury2/src/Texture.h =================================================================== --- Mercury2/src/Texture.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/Texture.h 2009-05-11 23:45:21 UTC (rev 220) @@ -19,7 +19,7 @@ void LoadFromRaw(); - inline static unsigned short NumberActiveTextures() { return m_activeTextures; } + inline static uint8_t NumberActiveTextures() { return m_activeTextures; } inline static uint32_t ReadAndResetBindCount() { uint32_t t = m_textureBinds; m_textureBinds = 0; return t; } static Texture* Generate(); @@ -27,7 +27,7 @@ void SetRawData(RawImageData* raw); private: - void LoadImage(const MString& path); + void LoadImagePath(const MString& path); void BindTexture(); void UnbindTexture(); @@ -37,7 +37,7 @@ unsigned int m_textureResource; static bool m_initTextureSuccess; - static unsigned short m_activeTextures; + static uint8_t m_activeTextures; static uint32_t m_textureBinds; // MString m_filename; Modified: Mercury2/src/TransformNode.cpp =================================================================== --- Mercury2/src/TransformNode.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/TransformNode.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -67,7 +67,9 @@ const TransformNode* tn; while (n) { - if ( (tn = TransformNode::Cast( n )) ) return tn->GetGlobalMatrix(); + tn = TransformNode::Cast( n ); + tn = TransformNode::Cast( n ); + if ( tn ) return tn->GetGlobalMatrix(); n = n->Parent(); } @@ -83,7 +85,8 @@ for (i = m_children.begin(); i != m_children.end(); ++i ) { - if ( (tn = TransformNode::Cast(*i)) ) + tn = TransformNode::Cast(*i); + if ( tn ) tn->SetTaint( true ); } } @@ -135,7 +138,8 @@ TransformNode* tn; while (n) { - if ( (tn = TransformNode::Cast( n )) ) + tn = TransformNode::Cast( n ); + if ( tn ) { tn->RippleTaintDown(); return; Modified: Mercury2/src/Viewport.cpp =================================================================== --- Mercury2/src/Viewport.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/Viewport.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -1,5 +1,5 @@ #include <Viewport.h> -#include <GL/gl.h> +#include <GLHeaders.h> #include <MercuryWindow.h> REGISTER_NODE_TYPE(Viewport); @@ -15,7 +15,7 @@ FRUSTUM = &m_frustum; MercuryWindow* w = MercuryWindow::GetCurrentWindow(); - glViewport(m_minx, m_miny, w->Width()*m_xFactor, w->Height()*m_yFactor); + glViewport(m_minx, m_miny, (GLsizei)(w->Width()*m_xFactor), (GLsizei)(w->Height()*m_yFactor)); glMatrixMode(GL_PROJECTION); @@ -34,8 +34,8 @@ { m_xFactor = StrToFloat(node.Attribute("xfactor"), 1.0f); m_yFactor = StrToFloat(node.Attribute("yfactor"), 1.0f); - m_minx = StrToFloat(node.Attribute("minx"), 0); - m_miny = StrToFloat(node.Attribute("miny"), 0); + m_minx = StrToInt(node.Attribute("minx"), 0); + m_miny = StrToInt(node.Attribute("miny"), 0); MercuryWindow* w = MercuryWindow::GetCurrentWindow(); Modified: Mercury2/src/Win32Window.cpp =================================================================== --- Mercury2/src/Win32Window.cpp 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/Win32Window.cpp 2009-05-11 23:45:21 UTC (rev 220) @@ -195,6 +195,16 @@ return true; } +void* Win32Window::GetProcAddress(const MString& x) +{ + return NULL; +} + +void Win32Window::Clear() +{ +} + + LRESULT CALLBACK WindowCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) Modified: Mercury2/src/Win32Window.h =================================================================== --- Mercury2/src/Win32Window.h 2009-04-26 16:46:17 UTC (rev 219) +++ Mercury2/src/Win32Window.h 2009-05-11 23:45:21 UTC (rev 220) @@ -15,6 +15,8 @@ virtual bool PumpMessages(); static MercuryWindow* GenWin32Window(); + virtual void* GetProcAddress(const MString& x); + virtual void Clear(); private: void GenWindow(); Added: Mercury2/src/glext.h =================================================================== --- Mercury2/src/glext.h (rev 0) +++ Mercury2/src/glext.h 2009-05-11 23:45:21 UTC (rev 220) @@ -0,0 +1,8782 @@ +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated $Date: 2009-05-05 15:27:42 -0700 (Tue, 05 May 2009) $ */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 52 + +/* Function declaration macros - to move into glplatform.h */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include <windows.h> +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_VERSION_1_2_DEPRECATED +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#endif + +#ifndef GL_ARB_imaging_DEPRECATED +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#endif + +#ifndef GL_VERSION_1_3_DEPRECATED +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#endif + +#ifndef GL_VERSION_1_4_DEPRECATED +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#endif + +#ifndef GL_VERSION_1_5_DEPRECATED +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING... [truncated message content] |