add commandline arguments to serialize demo for xml export and Bullet import file name

update AntTweakBar version in CDTestFramework
add btCompoundShape support in BulletXmlWorldImporter (this importer is still premature/work-in-progress)
This commit is contained in:
erwin.coumans
2012-09-26 19:47:18 +00:00
parent 60c1b1918a
commit 4442a826ed
85 changed files with 59310 additions and 18485 deletions

View File

@@ -0,0 +1,112 @@
/******************************************************************************
* Copyright 2010 Duane Merrill
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information, see our Google Code project site:
* http://code.google.com/p/back40computing/
*
* Thanks!
******************************************************************************/
#ifndef COMMAND_LINE_ARGS_H
#define COMMAND_LINE_ARGS_H
/******************************************************************************
* Command-line parsing
******************************************************************************/
#include <map>
#include <algorithm>
#include <string>
#include <sstream>
class CommandLineArguments
{
protected:
std::map<std::string, std::string> pairs;
public:
// Constructor
CommandLineArguments(int argc, char **argv)
{
using namespace std;
for (int i = 1; i < argc; i++)
{
string arg = argv[i];
if ((arg[0] != '-') || (arg[1] != '-')) {
continue;
}
string::size_type pos;
string key, val;
if ((pos = arg.find( '=')) == string::npos) {
key = string(arg, 2, arg.length() - 2);
val = "";
} else {
key = string(arg, 2, pos - 2);
val = string(arg, pos + 1, arg.length() - 1);
}
pairs[key] = val;
}
}
bool CheckCmdLineFlag(const char* arg_name)
{
using namespace std;
map<string, string>::iterator itr;
if ((itr = pairs.find(arg_name)) != pairs.end()) {
return true;
}
return false;
}
template <typename T>
void GetCmdLineArgument(const char *arg_name, T &val);
int ParsedArgc()
{
return pairs.size();
}
};
template <typename T>
void CommandLineArguments::GetCmdLineArgument(const char *arg_name, T &val)
{
using namespace std;
map<string, string>::iterator itr;
if ((itr = pairs.find(arg_name)) != pairs.end()) {
istringstream strstream(itr->second);
strstream >> val;
}
}
template <>
void CommandLineArguments::GetCmdLineArgument<char*>(const char* arg_name, char* &val)
{
using namespace std;
map<string, string>::iterator itr;
if ((itr = pairs.find(arg_name)) != pairs.end()) {
string s = itr->second;
val = (char*) malloc(sizeof(char) * (s.length() + 1));
strcpy(val, s.c_str());
} else {
val = NULL;
}
}
#endif //COMMAND_LINE_ARGS_H

View File

@@ -732,7 +732,13 @@ public:
};
#endif //DESERIALIZE_SOFT_BODIES
SerializeDemo::SerializeDemo()
:m_verboseMode(0),
m_fileName("testFile.bullet")
{
m_idle=true;
}
SerializeDemo::~SerializeDemo()
{
m_fileLoader->deleteAllData();
@@ -743,7 +749,7 @@ SerializeDemo::~SerializeDemo()
void SerializeDemo::initPhysics()
{
setTexturing(true);
setShadows(true);
setShadows(false);//true);
setCameraDistance(btScalar(SCALING*30.));
@@ -755,7 +761,7 @@ void SerializeDemo::initPhysics()
m_fileLoader = new btBulletWorldImporter(m_dynamicsWorld);
#endif //DESERIALIZE_SOFT_BODIES
//m_fileLoader->setVerboseMode(bParse::FD_VERBOSE_EXPORT_XML);
m_fileLoader->setVerboseMode(m_verboseMode);

View File

@@ -50,12 +50,12 @@ class SerializeDemo : public PlatformDemoApplication
btDefaultCollisionConfiguration* m_collisionConfiguration;
class btBulletWorldImporter* m_fileLoader;
const char* m_fileName;
int m_verboseMode;
public:
SerializeDemo()
{
}
SerializeDemo();
virtual ~SerializeDemo();
void initPhysics();
@@ -70,6 +70,24 @@ class SerializeDemo : public PlatformDemoApplication
virtual void displayCallback();
void setFileName(const char* name)
{
m_fileName = name;
}
const char* getFileName() const
{
return m_fileName;
}
void setVerboseMode(int mode)
{
m_verboseMode = mode;
}
int getVerboseMode() const
{
return m_verboseMode;
}
static DemoApplication* Create()
{
SerializeDemo* demo = new SerializeDemo;

View File

@@ -18,7 +18,8 @@ subject to the following restrictions:
#include "GLDebugDrawer.h"
#include "btBulletDynamicsCommon.h"
#include "LinearMath/btHashMap.h"
#include "btBulletFile.h"
#include "CommandLineArguments.h"
#ifdef USE_AMD_OPENCL
@@ -84,6 +85,22 @@ bool initCL( void* glCtx, void* glDC )
int main(int argc,char** argv)
{
CommandLineArguments arg(argc,argv);
char* filename=0;
arg.GetCmdLineArgument("filename", filename);
bool dumpXml = arg.CheckCmdLineFlag("dump_xml");
if (!dumpXml && !filename)
{
printf("There are some optional commandline arguments for this demo:\n");
printf("Load another .bullet file instead of testFile.bullet:\n");
printf("--filename=testfile.bullet\n");
printf("Dump the imported .bullet file to XML\n");
printf("--dump_xml\n");
}
GLDebugDrawer gDebugDrawer;
#ifdef USE_AMD_OPENCL
@@ -93,6 +110,14 @@ int main(int argc,char** argv)
SerializeDemo serializeDemo;
int mode = 0;
if (dumpXml)
mode |=bParse::FD_VERBOSE_EXPORT_XML;
if (filename)
serializeDemo.setFileName(filename);
serializeDemo.setVerboseMode(mode);
serializeDemo.initPhysics();
serializeDemo.getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);

View File

@@ -1,23 +1,208 @@
--- AntTweakBar library changes ---
--- AntTweakBar library release notes ---
- Version 1.04
OpenGL: Vertex buffer object state and Vertex/fragment program and object states are now reset and restored by TwDraw (thanks to Dylan and Siva for pointing this out).
* Version 1.15 (2012/07/22)
- Version 1.03 (2006/10/28)
Medium font is now antialiased.
Now also compiles on 64 bits x86 platform; use Makefile.x86_64 (thanks to Herling).
Slight changes to avoid visual 8 secure crt warnings.
Correct behaviour if min/max values are not defined.
Modif to avoid looping to max value when reaching zero with unsigned types.
Min/max/step commands for type TW_TYPE_CHAR now read ascii codes (not characters).
Add FPU precision control (because DirectX changes it).
Fix problem that occurs when the lib is initialized/unitialized more than once (thanks Lukasz for reporting it).
Distribution follows Savannah's recommendations.
- Added support for OpenGL Core Profile (3.2 and higher); it is enabled by
setting the TwGraphAPI parameter of the TwInit function to TW_OPENGL_CORE
(Thanks to Oystein E. and Arnaud M. for their contribution).
- Added a simple example that uses OpenGL Core Profile and SDL; see
TwGLCoreSDL.c .
- Added helper function TwEventX11 to handle native X11 events (Thanks to
Greg P. for the code).
- Added builtin fixed-width font for tweak bars; it is enabled through
the fontstyle bar parameter; it is not resizable (Thanks to Jay D. for
the font).
- Store and restore states of OpenGL vertex attribute arrays (Thanks to
Jerry J. and Eduard B.).
- Fixed memory access violation caused by the popup bar (Thanks to Matthias R.
for reporting it).
- Added code to overcome issue caused by the memory representation change
of std::string that occurs between Visual Studio 2008 and 2010.
- Version 1.02 (2006/09/27)
Library sources released.
* Version 1.14 (2011/03/26)
- Version 1.01 (2006/09/14)
First official release.
- Added 64 bit version of the library.
- Added multiple windows support (Inspired by comments and code from Evan F.
and Ivo H.)
- Better MacOSX support (Thanks to Alexis DH., Fabrice N., Diederick H.,
Alec J.).
- Improved readability of overlapped transparent bars. Content of overlapped
regions is clipped and not drawn. This behavior can be disabled using
the bar parameter "overlap".
- Added support for Direct3D11 (Thanks to Jorge H., Lukasz M., Se1zen).
- Added an example based on DirectX 11.
- Added support for SDL 1.3 integration in addition to SDL 1.2.
ABI modification: TwEventSDL takes SDL version as an additional parameter.
- Added support for SFML 1.6 integration.
- Added support for GLFW 2.7 integration in addition to GLFW 2.6. This may
imply changing the calling convention of event callbacks. Can be done by
defining GLFW_CDECL before including AntTweakBar.h if needed.
- Added function TwKeyTest that checks if a key event would be processed by
AntTweakBar but without processing it. Needed to fix bad handling report of
WM_KEYUP and WM_KEYDOWN in TwEventWin (Thanks to Ryan DB. for reporting it).
- Added check sign for vars of type boolean.
- Added new bar parameter "buttonalign" to center or left-align buttons
(Suggested by Michael R.).
- Allowed values column width to be adjusted to fit its content. This is done
by setting the bar parameter valueswidth=fit (Requested by Koshmaar and
Michael R.). The user can also click in the left or right area near the
value width slider to fit column content.
- Added new helper function TwDefineEnumFromString to ease the defining of an
enum through a string of comma-separated enum values (Thanks to Bruno L.
for the suggestion and code).
- Fixed compilation issues with gcc4 (missing includes, warnings).
- Fixes for the fedora package maintained by Sean Middleditch.
- Fixed rotation widget display and interaction issues when the library is
compiled with gcc -O3 (Thanks to Ares L. for reporting this).
- Fixed SDL key event SDLK_RETURN handling after a bar is minimized (Thanks
to Sean M. for reporting this).
- Fixed issue with SDL_ShowCursor (Thanks to Hugues M. for reporting it).
- Fixed DirectX10 resource issue.
- Store and restore GL_TEXTURE_COORD_ARRAY state (Thanks to Jerry J. for
reporting this).
- Fixed mouse click repetition issue with passive event loop (Thanks to
Bruno L. for reporting it).
- Fixed issue with mouse button event when glut windows doesn't have focus
(Thanks to Scott J. for the fix).
- Reset enum content each time the var parameter "enum" is set using TwDefine
or TwSetParam (Following Carsten W. and Sulaiman remarks).
- Fixed memory corruption when more than one std_string are defined in a
custom struct (Thanks to Sulaiman for reporting it).
- Fixed mouse position issue with Direct3D9 fullscreen mode in TwSimpleDX9
(Thanks to Paolo S. for pointing this out).
- Fixed ignored double-click in TwEvenWin (Thanks to H. Seungho for this).
* Version 1.13 (2009/04/19)
- Now compiles on Mac OSX (Many thanks to Evan F. for rewritting the OS
specific code, and to Tyler S. and Konstantin L. for their feedback).
- Added functions TwGetBarCount, TwGetBarByIndex, TwGetBarByName,
TwRefreshBar.
- Fixed bug related to var of type TW_TYPE_STDSTRING on Windows: Microsoft
implementation of std::string does not have the same size in Debug and
Release mode (hidden member added for debugging), which caused a crash when
mixing the Release version of AntTweakBar with a program compiled in Debug
mode (Thanks to Minh D. for reporting it).
- Added function TwGetParam and TwSetParam to allow access to the parameters
defining the behavior of bars and variables.
- Changed the bar/var parameters without value (like "show"/"hide") to
parameters with value ("visible=true or false") to be compatible with the
new TwGetParam and TwSetParam functions (the old syntax is still kept
for backward compatibility).
- Arrow keys and Return key can now be used to navigate and tweak values.
- Bars can now be moved partly outside of the window. They can still be
constrained to be fully contained in the window by setting the parameter
"contained=true".
- Added another way to move a bar by pressing mouse middle button in the bar.
* Version 1.12 (2008/09/27)
- Added new var types TW_TYPE_QUAT* and TW_TYPE_DIR* allowing for the
interactive tweaking of rotations (through quaternions) and 3D vectors
(directions).
- Better management of transparent tweak bars. New bar parameters added:
alpha=n text=dark/light.
- Default color scheme changed (now transparent by default). To reactivate the
previous scheme, call TwDefine("GLOBAL colorscheme=0") before creating bars.
- Added paramters to manage the bar behavior: resizable, movable, iconifiable,
fontresizable, alwaystop, alwaysbottom, visible, iconified (following
Jeppe F. B. feedback).
- Added functions TwSetBottomBar and TwGetBottomBar.
- The library can now be recompiled without requiring to install GLUT, GLFW
and SDL.
- New var parameters arrow, arrowcolor, axisx, axusy, axisz and showval added
for quaternion and direction types.
- Msvc specific keyword removed from PrefTimer (thanks to Tim J. for pointing
this out).
- Fixed bug related to popup behavior when the help bar is visible.
- GL_TEXTURE_RECTANGLE_ARB/EXT state is now saved and restored by TwDraw
(thanks to Cyril C. for suggesting this).
- glBlendFunc and glBlendEquationEXT are now saved and restored by TwDraw
(thanks to Sebastion B. for reporting the problem).
- Fixed bug related cursor visibility state with SDL (Thanks to Jeppe F. B.
for reporting it).
* Version 1.11 (2007/12/10)
- Now DirectX10 is also supported in addition to OpenGL and DirectX9.
Initialization of AntTweakBar with DX10: TwInit(TW_DIRECT3D10, d3d10Device).
- A new example that uses DirectX10 has been added: see TwSimpleDX10 in the
examples directory.
- Recap for string variables added to the doc. See
http://www.antisphere.com/Wiki/tools:anttweakbar:varstring
- An example that illustrates the use of the different types of string
variables has been added. See TwString in the examples directory.
- Added some code for multi-thread safety (thanks to Daniel 'DrUiD' B. for
the tip).
- Cleanup of the Help bar. Now only variables having help are displayed in
the Help bar.
- Function TwHandleErrors documented.
- Separators don't require a name anymore.
- Var parameter 'order' becomes 'colororder', and its values become 'rgba' and
'argb' (order=ogl and order=dx still exist but are deprecated).
- A small icon added for variables of type bool.
- Function TwCopyCDStringToLibrary added.
- The keyword 'GLOBAL' has been added for TwDefine commands that don't apply
to a specific tweak bar (suggested by Koshmaar).
- TwEventWin32 becomes TwEventWin (a #define has been added to keep
compatibility with previous applications).
- TwWindowSize(0,0) now releases graphics resources allocated by AntTweakBar
(may be useful for Direct3D applications, before resizing for instance).
- A wrong assert removed from TwMgr.cpp (thanks to Chris W. for reporting it).
- Some slight cosmetic changes (again).
* Version 1.10 (2007/08/31)
- Variable values can now also be entered and edited via keyboard input
(implementation based on modifications made by Laury M., thank you Laury).
- Variables of type string are now handled: 3 types of string added
TW_TYPE_CSSTRING, TW_TYPE_CDSTRING and TW_STDSTRING.
- Text selection and copy/paste added.
- Position of bar icons is modifiable (cf. TwBar paramters iconPos, iconAlign
and iconMargin).
- Separators can be added in a bar (TwAddSeparator).
- OpenGL: states related to 3D textures and multitexturing are now saved and
restored by TwDraw (thanks to Dylan D. for pointing this out).
- Selected element of a listbox now highlighted.
- ReadOnly and ReadWrite behavior of buttons revisited.
- Documentation improved (examples for TwType, new functions documented,...).
- Some slight cosmetic changes.
* Version 1.05 (2007/03/01)
- Listbox and rotoslider buttons added.
- Icon resources (AntTweakBar.rc) no more required for static linkage (thanks
to Joe C. for pointing this out).
- Fixed a rotoslider precision problem when mouse button is released.
* Version 1.04 (2006/12/16)
- OpenGL: Vertex buffer object state and Vertex/fragment program and object
states are now reset and restored by TwDraw (thanks to Dylan D. and Siva K.
for pointing this out).
- Fixed problem that occurs when an initialized variable of type float/double
is displayed.
* Version 1.03 (2006/10/28)
- Medium font antialiased.
- Now also compiles on 64 bits x86 platform (thanks to Herling G. for this).
- Slight changes to avoid visual 8 secure crt warnings.
- Corrected behaviour if min/max values are not defined.
- Modif to avoid looping to max value when reaching zero with unsigned types.
- Min/max/step parameters for type TW_TYPE_CHAR now read ascii codes (not
characters).
- Added FPU precision control (because DirectX changes it).
- Fixed problem that occurs when the lib is initialized/uninitialized more
than once (thanks Lukasz P. for reporting it).
- Distribution follows Savannah's recommendations.
* Version 1.02 (2006/09/27)
- Library sources released.
* Version 1.01 (2006/09/14)
- First official release.

View File

@@ -1,13 +1,18 @@
RMDIR /S /Q src\debug
RMDIR /S /Q src\release
RMDIR /S /Q src\debug32
RMDIR /S /Q src\debug64
RMDIR /S /Q src\release32
RMDIR /S /Q src\release64
CD src
DEL *.ncb *.aps *.o *.bak
DEL *.ncb *.aps *.o *.bak *.user
DEL /A:h *.suo
CD ..
RMDIR /S /Q lib\debug
RMDIR /S /Q examples\debug
RMDIR /S /Q examples\debug32
RMDIR /S /Q examples\debug64
RMDIR /S /Q examples\tmp
DEL lib\*.exp
CD examples
DEL *.ncb *.aps *.o *.bak
DEL *.ncb *.aps *.o *.bak *.user
DEL /A:h *.suo
DEL /S BuildLog.htm
DEL bin\*.obj

View File

@@ -1,18 +1,19 @@
--- AntTweakBar license ---
--- AntTweakBar license ---
Copyright <EFBFBD> 2005, 2006 Philippe Decaudin
Copyright (C) 2005-2012 Philippe Decaudin
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from
the use of this software.
In no event will the authors be held liable for any damages arising from the
use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to
the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim
that you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated.
an acknowledgment in the product documentation would be appreciated but is not
required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.

View File

@@ -3,13 +3,13 @@
AntTweakBar is a small and easy-to-use C/C++ library that allows programmers
to quickly add a light and intuitive GUI into OpenGL and DirectX based
graphic programs to interactively tweak them.
graphic programs to interactively tweak parameters.
This package includes the development version of the AntTweakBar library
for GNU/Linux and Windows, + some program examples (sources + binaries).
for Windows, GNU/Linux and OSX, and some program examples (sources + binaries).
For installation and documentation please refer to:
http://www.antisphere.com/Wiki/tools:anttweakbar
Philippe Decaudin - http://www.antisphere.com - 2006/05/20
Philippe Decaudin - http://www.antisphere.com

View File

@@ -1,65 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwCopyDLL", "TwCopyDLL.vcproj", "{AB180E0E-0EFA-4AD4-8F08-4492D144D963}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleGLFW", "TwSimpleGLFW.vcproj", "{29C096AF-172E-4A36-A1FE-E15B259D6834}"
ProjectSection(ProjectDependencies) = postProject
{AB180E0E-0EFA-4AD4-8F08-4492D144D963} = {AB180E0E-0EFA-4AD4-8F08-4492D144D963}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleGLUT", "TwSimpleGLUT.vcproj", "{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}"
ProjectSection(ProjectDependencies) = postProject
{AB180E0E-0EFA-4AD4-8F08-4492D144D963} = {AB180E0E-0EFA-4AD4-8F08-4492D144D963}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleSDL", "TwSimpleSDL.vcproj", "{3B516919-D0DA-43CE-820E-8306368F605B}"
ProjectSection(ProjectDependencies) = postProject
{AB180E0E-0EFA-4AD4-8F08-4492D144D963} = {AB180E0E-0EFA-4AD4-8F08-4492D144D963}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwSimpleDX9", "TwSimpleDX9.vcproj", "{6B414E54-701C-4ED3-9034-F5CD7BFC3451}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwAdvanced1", "TwAdvanced1.vcproj", "{008D1CEC-1586-4C89-B524-DF15D9605163}"
ProjectSection(ProjectDependencies) = postProject
{AB180E0E-0EFA-4AD4-8F08-4492D144D963} = {AB180E0E-0EFA-4AD4-8F08-4492D144D963}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug.ActiveCfg = Debug|Win32
{AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Debug.Build.0 = Debug|Win32
{AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release.ActiveCfg = Release|Win32
{AB180E0E-0EFA-4AD4-8F08-4492D144D963}.Release.Build.0 = Release|Win32
{29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug.ActiveCfg = Debug|Win32
{29C096AF-172E-4A36-A1FE-E15B259D6834}.Debug.Build.0 = Debug|Win32
{29C096AF-172E-4A36-A1FE-E15B259D6834}.Release.ActiveCfg = Release|Win32
{29C096AF-172E-4A36-A1FE-E15B259D6834}.Release.Build.0 = Release|Win32
{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug.ActiveCfg = Debug|Win32
{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Debug.Build.0 = Debug|Win32
{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release.ActiveCfg = Release|Win32
{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}.Release.Build.0 = Release|Win32
{3B516919-D0DA-43CE-820E-8306368F605B}.Debug.ActiveCfg = Debug|Win32
{3B516919-D0DA-43CE-820E-8306368F605B}.Debug.Build.0 = Debug|Win32
{3B516919-D0DA-43CE-820E-8306368F605B}.Release.ActiveCfg = Release|Win32
{3B516919-D0DA-43CE-820E-8306368F605B}.Release.Build.0 = Release|Win32
{6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug.ActiveCfg = Debug|Win32
{6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Debug.Build.0 = Debug|Win32
{6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release.ActiveCfg = Release|Win32
{6B414E54-701C-4ED3-9034-F5CD7BFC3451}.Release.Build.0 = Release|Win32
{008D1CEC-1586-4C89-B524-DF15D9605163}.Debug.ActiveCfg = Debug|Win32
{008D1CEC-1586-4C89-B524-DF15D9605163}.Debug.Build.0 = Debug|Win32
{008D1CEC-1586-4C89-B524-DF15D9605163}.Release.ActiveCfg = Release|Win32
{008D1CEC-1586-4C89-B524-DF15D9605163}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@@ -1,80 +0,0 @@
####### Compiler, tools and options
#---- MinGW
#MINGWFLAGS = -mno-cygwin
#---- Release
CXXCFG = -O3
LFLAGS = -L../lib
OUT_DIR = bin
#---- Debug
#CXXCFG = -g -D_DEBUG
#LFLAGS = -Wl -L../lib/debug
#OUT_DIR = debug
CXX = gcc
#CXXFLAGS = $(CXXCFG) $(MINGWFLAGS) -pipe -Wall -ffast-math -fPIC -fno-strength-reduce -mcpu=pentiumpro -march=i586
CXXFLAGS = $(CXXCFG) -Wall -mcpu=i386 -march=i386
INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include
LIBS = -L/usr/X11R6/lib -lAntTweakBar -lGL -lGLU -lX11 -lXxf86vm -lXext -lXmu -lpthread -lm
DEL_FILE = rm -f
DEL_DIR = rmdir
NO_STDERR = 2> /dev/null
EXP_PATH = "export LD_LIBRARY_PATH=\"../../lib:$(LD_LIBRARY_PATH)\""
####### Files
SRC_FILES = TwSimpleGLFW.c TwSimpleGLUT.c TwSimpleSDL.c TwAdvanced1.cpp
####### Build rules
#first: depend all
first: all
all: Makefile $(SRC_FILES)
@echo "===== Build TwSimpleGLFW ===="
$(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLFW.c $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwSimpleGLFW.out
@echo "$(EXP_PATH) ; ./TwSimpleGLFW.out" > $(OUT_DIR)/TwSimpleGLFW
@echo "===== Build TwSimpleGLUT ===="
$(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLUT.c $(LFLAGS) -lglut $(LIBS) -o $(OUT_DIR)/TwSimpleGLUT.out
@echo "$(EXP_PATH) ; ./TwSimpleGLUT.out" > $(OUT_DIR)/TwSimpleGLUT
@echo "===== Build TwSimpleSDL ===="
$(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleSDL.c $(LFLAGS) -lSDL $(LIBS) -o $(OUT_DIR)/TwSimpleSDL.out
@echo "$(EXP_PATH) ; ./TwSimpleSDL.out" > $(OUT_DIR)/TwSimpleSDL
@echo "===== Build TwAdvanced1 ===="
$(CXX) $(CXXFLAGS) $(INCPATH) TwAdvanced1.cpp $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwAdvanced1.out
@echo "$(EXP_PATH) ; ./TwAdvanced1.out" > $(OUT_DIR)/TwAdvanced1
# append dependencies to this Makefile
#depend:
# @echo "===== Make dependencies ====="
# makedepend -Y
# makedepend -a -Y -- $(CXXFLAGS) $(INCPATH) -- $(SRC_FILES) $(NO_STDERR)
# clean temporary files
clean:
@echo "===== Clean ====="
-$(DEL_FILE) *.o
-$(DEL_FILE) *~ core *.core *.stackdump
-$(DEL_FILE) debug/*
-$(DEL_DIR) debug
####### DEPENDENCIES
TwSimpleGLFW.o: ../include/AntTweakBar.h
TwSimpleGLUT.o: ../include/AntTweakBar.h
TwSimpleSDL.o: ../include/AntTweakBar.h
TwAdvanced1.o: ../include/AntTweakBar.h

View File

@@ -1,82 +0,0 @@
####### Compiler, tools and options
#---- MinGW
#MINGWFLAGS = -mno-cygwin
#---- Release
CXXCFG = -O3
LFLAGS = -L../lib
OUT_DIR = bin
#---- Debug
#CXXCFG = -g -D_DEBUG
#LFLAGS = -Wl -L./debug
#OUT_DIR = debug
CXX = gcc
#CXXFLAGS = $(CXXCFG) $(MINGWFLAGS) -pipe -Wall -ffast-math -fpic -fno-strength-reduce -mcpu=pentiumpro -march=i586
#CXXFLAGS = $(CXXCFG) -Wall -mcpu=i386 -march=i386
CXXFLAGS = $(CXXCFG) -Wall
INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include
#LIBS = -L/usr/X11R6/lib -lAntTweakBar -lGL -lGLU -lX11 -lXxf86vm -lXext -lXmu -lpthread -lm
LIBS = -L/usr/lib64 -lAntTweakBar -lglfw -lGL -lGLU -lX11 -lXxf86vm -lXext -lXmu -lpthread -lm
DEL_FILE = rm -f
DEL_DIR = rmdir
NO_STDERR = 2> /dev/null
EXP_PATH = "export LD_LIBRARY_PATH=\"../../lib:$(LD_LIBRARY_PATH)\""
####### Files
SRC_FILES = TwSimpleGLFW.c TwSimpleGLUT.c TwSimpleSDL.c TwAdvanced1.cpp
####### Build rules
#first: depend all
first: all
all: Makefile $(SRC_FILES)
@echo "===== Build TwSimpleGLFW ===="
$(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLFW.c $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwSimpleGLFW.out
@echo "$(EXP_PATH) ; ./TwSimpleGLFW.out" > $(OUT_DIR)/TwSimpleGLFW
@echo "===== Build TwSimpleGLUT ===="
$(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleGLUT.c $(LFLAGS) -lglut $(LIBS) -o $(OUT_DIR)/TwSimpleGLUT.out
@echo "$(EXP_PATH) ; ./TwSimpleGLUT.out" > $(OUT_DIR)/TwSimpleGLUT
@echo "===== Build TwSimpleSDL ===="
$(CXX) $(CXXFLAGS) $(INCPATH) TwSimpleSDL.c $(LFLAGS) -lSDL $(LIBS) -o $(OUT_DIR)/TwSimpleSDL.out
@echo "$(EXP_PATH) ; ./TwSimpleSDL.out" > $(OUT_DIR)/TwSimpleSDL
@echo "===== Build TwAdvanced1 ===="
$(CXX) $(CXXFLAGS) $(INCPATH) TwAdvanced1.cpp $(LFLAGS) -lglfw $(LIBS) -o $(OUT_DIR)/TwAdvanced1.out
@echo "$(EXP_PATH) ; ./TwAdvanced1.out" > $(OUT_DIR)/TwAdvanced1
# append dependencies to this Makefile
#depend:
# @echo "===== Make dependencies ====="
# makedepend -Y
# makedepend -a -Y -- $(CXXFLAGS) $(INCPATH) -- $(SRC_FILES) $(NO_STDERR)
# clean temporary files
clean:
@echo "===== Clean ====="
-$(DEL_FILE) *.o
-$(DEL_FILE) *~ core *.core *.stackdump
-$(DEL_FILE) debug/*
-$(DEL_DIR) debug
####### DEPENDENCIES
TwSimpleGLFW.o: ../include/AntTweakBar.h
TwSimpleGLUT.o: ../include/AntTweakBar.h
TwSimpleSDL.o: ../include/AntTweakBar.h
TwAdvanced1.o: ../include/AntTweakBar.h

View File

@@ -1,693 +0,0 @@
// ---------------------------------------------------------------------------
//
// @file TwAdvanced1.cpp
// @brief An example showing many features of AntTweakBar.
// It also uses OpenGL and GLFW windowing system
// but could be easily adapted to other frameworks.
//
// AntTweakBar: http://www.antisphere.com/Wiki/tools:anttweakbar
// OpenGL: http://www.opengl.org
// GLFW: http://glfw.sourceforge.net
//
//
// This example draws a simple scene that can be re-tesselated
// interactively, and illuminated dynamically by an adjustable
// number of moving lights.
//
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/20
//
// note: TAB=4
//
// Compilation:
// http://www.antisphere.com/Wiki/tools:anttweakbar:examples#twadvanced1
//
// ---------------------------------------------------------------------------
#include <AntTweakBar.h>
#define GLFW_DLL // use GLFW as a dynamically linked library
#include "glfw.h"
#include <cmath>
#include <iostream>
#ifndef _WIN32
# define _snprintf snprintf
#endif
const float FLOAT_2PI = 6.283185307f; // 2*PI
// Light structure: embed light parameters
struct Light
{
bool Active; // light On or Off
float Pos[4]; // light position (in homogeneous coordinates, ie. Pos[4]=1)
float Color[4]; // light color (no alpha, ie. Color[4]=1)
float Radius; // radius of the light influence area
float Dist0, Angle0, Height0, Speed0; // light initial cylindrical coordinates and speed
char Name[4]; // light short name (will be named "1", "2", "3",...)
enum AnimMode { ANIM_FIXED, ANIM_BOUNCE, ANIM_ROTATE, ANIM_COMBINED };
AnimMode Animation; // light animation mode
};
// Class that describes the scene and its methods
class Scene
{
public:
bool Wireframe; // draw scene in wireframe or filled
int Subdiv; // number of subdivisions used to tesselate the scene
int NumLights; // number of dynamic lights
float BgColor0[3], BgColor1[3]; // top and bottom background colors
float Ambient; // scene ambient factor
float Reflection; // ground plane reflection factor (0=no reflection, 1=full reflection)
float RotYAngle; // rotation angle of the scene around its Y axis (in degree)
enum RotMode { ROT_OFF, ROT_CW, ROT_CCW };
RotMode Rotation; // scene rotation mode (off, clockwise, counter-clockwise)
Scene(); // constructor
~Scene(); // destructor
void Init(bool changeLightPos); // (re)intialize the scene
void Draw(); // draw scene
void Update(float time); // move lights
private:
void CreateBar(); // create a tweak bar for lights
// Some drawing subroutines
void DrawSubdivPlaneY(float xMin, float xMax, float y, float zMin, float zMax, int xSubdiv, int zSubdiv);
void DrawSubdivCylinderY(float xCenter, float yBottom, float zCenter, float height, float radiusBottom, float radiusTop, int sideSubdiv, int ySubdiv);
void DrawSubdivHaloZ(float x, float y, float z, float radius, int subdiv);
void DrawHalos(bool reflected);
GLuint objList, groundList, haloList; // OpenGL display list IDs
int maxLights; // maximum number of dynamic lights allowed by the graphic card
Light * lights; // array of lights
TwBar * lightsBar; // pointer to the tweak bar for lights created by CreateBar()
};
// Constructor
Scene::Scene()
{
// Set scene members.
// The scene will be created by Scene::Init( )
Wireframe = false;
Subdiv = 20;
NumLights = 0;
BgColor0[0] = 0.9f;
BgColor0[1] = 0.0f;
BgColor0[2] = 0.0f;
BgColor1[0] = 0.6f;
BgColor1[1] = 0.6f;
BgColor1[2] = 0.6f;
Ambient = 0.3f;
Reflection = 0.5f;
RotYAngle = 0;
Rotation = ROT_CCW;
objList = 0;
groundList = 0;
haloList = 0;
maxLights = 0;
lights = NULL;
lightsBar = NULL;
}
// Destructor
Scene::~Scene()
{
// delete all lights
if( lights )
delete[] lights;
}
// Create the scene, and (re)initialize lights if changeLights is true
void Scene::Init(bool changeLights)
{
// Get the max number of lights allowed by the graphic card
glGetIntegerv(GL_MAX_LIGHTS, &maxLights);
if( maxLights>16 )
maxLights = 16;
// Create the lights array
if( lights==NULL && maxLights>0 )
{
lights = new Light[maxLights];
NumLights = maxLights/2; // default number of lights
if( NumLights==0 )
NumLights = 1;
changeLights = true; // force lights initialization
// Create a tweak bar for lights
CreateBar();
}
// (Re)initialize lights if needed (uses random values)
if( changeLights )
for(int i=0; i<maxLights; ++i)
{
lights[i].Dist0 = 0.5f*(float)rand()/RAND_MAX + 0.55f;
lights[i].Angle0 = FLOAT_2PI*((float)rand()/RAND_MAX);
lights[i].Height0 = FLOAT_2PI*(float)rand()/RAND_MAX;
lights[i].Speed0 = 4.0f*(float)rand()/RAND_MAX - 2.0f;
lights[i].Animation = Light::ANIM_BOUNCE;
lights[i].Radius = (float)rand()/RAND_MAX+0.05f;
lights[i].Color[0] = (float)rand()/RAND_MAX;
lights[i].Color[1] = (float)rand()/RAND_MAX;
lights[i].Color[2] = (lights[i].Color[0]>lights[i].Color[1]) ? 1.0f-lights[i].Color[1] : 1.0f-lights[i].Color[0];
lights[i].Color[3] = 1;
lights[i].Active = true;
}
// Initialize some OpenGL states
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_LIGHTING);
glEnable(GL_CULL_FACE);
glEnable(GL_NORMALIZE);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
// Create objects display list using the current Subdiv parameter to control the tesselation
if( objList>0 )
glDeleteLists(objList, 1); // delete previously created display list
objList = glGenLists(1);
glNewList(objList, GL_COMPILE);
DrawSubdivCylinderY(-0.9f, 0, -0.9f, 1.4f, 0.15f, 0.12f, Subdiv/2+8, Subdiv);
DrawSubdivCylinderY(+0.9f, 0, -0.9f, 1.4f, 0.15f, 0.12f, Subdiv/2+8, Subdiv);
DrawSubdivCylinderY(+0.9f, 0, +0.9f, 1.4f, 0.15f, 0.12f, Subdiv/2+8, Subdiv);
DrawSubdivCylinderY(-0.9f, 0, +0.9f, 1.4f, 0.15f, 0.12f, Subdiv/2+8, Subdiv);
DrawSubdivCylinderY(0, 0, 0, 0.4f, 0.5f, 0.3f, Subdiv+16, Subdiv/8+1);
DrawSubdivCylinderY(0, 0.4f, 0, 0.05f, 0.3f, 0.0f, Subdiv+16, Subdiv/16+1);
glEndList();
// Create ground display list
if( groundList>0 )
glDeleteLists(groundList, 1); // delete previously created display list
groundList = glGenLists(1);
glNewList(groundList, GL_COMPILE);
DrawSubdivPlaneY(-1.2f, 1.2f, 0, -1.2f, 1.2f, (3*Subdiv)/2, (3*Subdiv)/2);
glEndList();
// Create display list to draw light halos
if( haloList>0 )
glDeleteLists(haloList, 1); // delete previously created display list
haloList = glGenLists(1);
glNewList(haloList, GL_COMPILE);
DrawSubdivHaloZ(0, 0, 0, 1, 32);
glEndList();
}
// Callback function associated to the 'Change lights' button of the lights tweak bar.
void TW_CALL ReinitCB(void *clientData)
{
Scene *scene = static_cast<Scene *>(clientData); // scene pointer is stored in clientData
scene->Init(true); // re-initialize the scene
}
// Create a tweak bar for lights.
// New enum type and struct type are defined and used by this bar.
void Scene::CreateBar()
{
// Create a new tweak bar and change its label
lightsBar = TwNewBar("Lights");
TwDefine(" Lights label='Lights TweakBar' ");
// Add a variable of type int to control the number of lights
TwAddVarRW(lightsBar, "NumLights", TW_TYPE_INT32, &NumLights, " label='Number of lights' keyIncr=l keyDecr=L ");
// Set the NumLights min value (=0) and max value (depends on the user graphic card)
char def[256];
_snprintf(def, 255, "Lights/NumLights min=0 max=%d", maxLights);
TwDefine(def); // min and max are defined using a defintion string
// Add a button to re-initialize the lights; this button calls the ReinitCB callback function
TwAddButton(lightsBar, "Reinit", ReinitCB, this, " label='Change lights' key=RETURN ");
// Define a new enum type for the tweak bar
TwEnumVal modeEV[] = // array used to describe the Scene::AnimMode enum values
{
{ Light::ANIM_FIXED, "Fixed" },
{ Light::ANIM_BOUNCE, "Bounce" },
{ Light::ANIM_ROTATE, "Rotate" },
{ Light::ANIM_COMBINED, "Combined" }
};
TwType modeType = TwDefineEnum("Mode", modeEV, 4); // create a new TwType associated to the enum defined by the modeEV array
// Define a new struct type: light variables are embeded in this structure
TwStructMember lightMembers[] = // array used to describe tweakable variables of the Light structure
{
{ "Active", TW_TYPE_BOOLCPP, offsetof(Light, Active), "" }, // Light::Active is a C++ boolean value
{ "Color", TW_TYPE_COLOR4F, offsetof(Light, Color), "noalpha" }, // Light::Color is represented by 4 floats, but alpha channel should be ignored
{ "Radius", TW_TYPE_FLOAT, offsetof(Light, Radius), "min=0 max=4 step=0.02" },
{ "Animation", modeType, offsetof(Light, Animation), "" }, // use the enum 'modeType' created before to tweak the Light::Animation variable
{ "Speed", TW_TYPE_FLOAT, offsetof(Light, Speed0), "readonly" } // Light::Speed is made read-only
};
TwType lightType = TwDefineStruct("Light", lightMembers, 5, sizeof(Light), NULL, NULL); // create a new TwType associated to the struct defined by the lightMembers array
// Use the newly created 'lightType' to add variables associated with lights
for(int i=0; i<maxLights; ++i) // Add 'maxLights' variables of type lightType; unused lights variables (over NumLights) will hidden by Scene::Update( )
{
_snprintf(lights[i].Name, 3, "%d", i+1); // Create a name for each light ("1", "2", "3",...)
TwAddVarRW(lightsBar, lights[i].Name, lightType, &lights[i], "group='Edit lights'"); // Add a lightType variable and group it into the 'Edit lights' group
}
}
// Move lights
void Scene::Update(float time)
{
float horizSpeed, vertSpeed;
for(int i=0; i<NumLights; ++i)
{
// Change light position according to its current animation mode
if( lights[i].Animation==Light::ANIM_ROTATE || lights[i].Animation==Light::ANIM_COMBINED )
horizSpeed = lights[i].Speed0;
else
horizSpeed = 0;
if( lights[i].Animation==Light::ANIM_BOUNCE || lights[i].Animation==Light::ANIM_COMBINED )
vertSpeed = 1;
else
vertSpeed = 0;
lights[i].Pos[0] = lights[i].Dist0 * (float)cos(horizSpeed*time + lights[i].Angle0);
lights[i].Pos[1] = (float)fabs(cos(vertSpeed*time + lights[i].Height0));
lights[i].Pos[2] = lights[i].Dist0 * (float)sin(horizSpeed*time + lights[i].Angle0);
lights[i].Pos[3] = 1;
}
}
// Activate OpenGL lights; hide unused lights in the Lights tweak bar;
// and draw the scene. The scene is reflected by the ground plane, so it is
// drawn two times: first reflected, and second normal (unreflected).
void Scene::Draw()
{
int i;
char def[32]; // definition string used to show/hide tweakable lights
for(i=0; i<maxLights; ++i)
{
strcpy(def, "Lights/");
strcat(def, lights[i].Name); // name of the current light
if( i<NumLights )
{
// Lights under NumLights are shown in the Lights tweak bar
strcat(def, " show");
// Tell OpenGL to enable or disable the light
if( lights[i].Active )
glEnable(GL_LIGHT0+i);
else
glDisable(GL_LIGHT0+i);
// Update OpenGL light parameters (for the reflected scene)
float reflectPos[4] = { lights[i].Pos[0], -lights[i].Pos[1], lights[i].Pos[2], lights[i].Pos[3] };
glLightfv(GL_LIGHT0+i, GL_POSITION, reflectPos);
glLightfv(GL_LIGHT0+i, GL_DIFFUSE, lights[i].Color);
glLightf(GL_LIGHT0+i, GL_CONSTANT_ATTENUATION, 1);
glLightf(GL_LIGHT0+i, GL_LINEAR_ATTENUATION, 0);
glLightf(GL_LIGHT0+i, GL_QUADRATIC_ATTENUATION, 1.0f/(lights[i].Radius*lights[i].Radius));
}
else
{
// Lights over NumLights are hidden in the Lights tweak bar
strcat(def, " hide");
// Disable the OpenGL light
glDisable(GL_LIGHT0+i);
}
// Show or hide the light variable in the Lights tweak bar
TwDefine(def);
}
// Set global ambient and clear screen and depth buffer
float ambient[4] = { Ambient*(BgColor0[0]+BgColor1[0])/2, Ambient*(BgColor0[1]+BgColor1[1])/2, Ambient*(BgColor0[2]+BgColor1[2])/2, 1 };
glClearColor(ambient[0], ambient[1], ambient[2], 1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
// Rotate the scene
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(RotYAngle, 0, 1, 0);
// Draw the reflected scene
glPolygonMode(GL_FRONT_AND_BACK, (Wireframe ? GL_LINE : GL_FILL));
glCullFace(GL_FRONT);
glPushMatrix();
glScalef(1, -1, 1);
glColor3f(1, 1, 1);
glCallList(objList);
DrawHalos(true);
glPopMatrix();
glCullFace(GL_BACK);
// clear depth buffer again
glClear(GL_DEPTH_BUFFER_BIT);
// Draw the ground plane (using the Reflection parameter as transparency)
glColor4f(1, 1, 1, 1.0f-Reflection);
glCallList(groundList);
// Draw the gradient background (requires to switch to screen-space normalized coordinates)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDisable(GL_LIGHTING);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glBegin(GL_QUADS);
glColor3f(BgColor0[0], BgColor0[1], BgColor0[2]);
glVertex3f(-1, -1, 0.9f);
glVertex3f(1, -1, 0.9f);
glColor3f(BgColor1[0], BgColor1[1], BgColor1[2]);
glVertex3f(1, 1, 0.9f);
glVertex3f(-1, 1, 0.9f);
glEnd();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glEnable(GL_LIGHTING);
// Update light positions for unreflected scene
for(i=0; i<NumLights; ++i)
glLightfv(GL_LIGHT0+i, GL_POSITION, lights[i].Pos);
// Draw the unreflected scene
glPolygonMode(GL_FRONT_AND_BACK, (Wireframe ? GL_LINE : GL_FILL));
glColor3f(1, 1, 1);
glCallList(objList);
DrawHalos(false);
}
// Subroutine used to draw halos around light positions
void Scene::DrawHalos(bool reflected)
{
//glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glDepthMask(GL_FALSE);
float prevAmbient[4];
glGetFloatv(GL_LIGHT_MODEL_AMBIENT, prevAmbient);
glPushMatrix();
glLoadIdentity();
if( reflected )
glScalef(1, -1 ,1);
float black[4] = {0, 0, 0, 1};
float cr = (float)cos(FLOAT_2PI*RotYAngle/360.0f);
float sr = (float)sin(FLOAT_2PI*RotYAngle/360.0f);
for(int i=0; i<NumLights; ++i)
{
if( lights[i].Active )
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lights[i].Color);
else
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, black);
glPushMatrix();
glTranslatef(cr*lights[i].Pos[0]+sr*lights[i].Pos[2], lights[i].Pos[1], -sr*lights[i].Pos[0]+cr*lights[i].Pos[2]);
//glScalef(0.5f*lights[i].Radius, 0.5f*lights[i].Radius, 1);
glScalef(0.05f, 0.05f, 1);
glCallList(haloList);
glPopMatrix();
}
glPopMatrix();
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, prevAmbient);
glDepthMask(GL_TRUE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
// Subroutine used to build the ground plane display list (mesh subdivision is adjustable)
void Scene::DrawSubdivPlaneY(float xMin, float xMax, float y, float zMin, float zMax, int xSubdiv, int zSubdiv)
{
const float FLOAT_EPS = 1.0e-5f;
float dx = (xMax-xMin)/xSubdiv;
float dz = (zMax-zMin)/zSubdiv;
glBegin(GL_QUADS);
glNormal3f(0, -1, 0);
for( float z=zMin; z<zMax-FLOAT_EPS; z+=dz )
for( float x=xMin; x<xMax-FLOAT_EPS; x+=dx )
{
glVertex3f(x, y, z);
glVertex3f(x, y, z+dz);
glVertex3f(x+dx, y, z+dz);
glVertex3f(x+dx, y, z);
}
glEnd();
}
// Subroutine used to build objects display list (mesh subdivision is adjustable)
void Scene::DrawSubdivCylinderY(float xCenter, float yBottom, float zCenter, float height, float radiusBottom, float radiusTop, int sideSubdiv, int ySubdiv)
{
float h0, h1, y0, y1, r0, r1, a0, a1, cosa0, sina0, cosa1, sina1;
glBegin(GL_QUADS);
glNormal3f(0, 1, 0);
for( int j=0; j<ySubdiv; ++j )
for( int i=0; i<sideSubdiv; ++i )
{
h0 = (float)j/ySubdiv;
h1 = (float)(j+1)/ySubdiv;
y0 = yBottom + h0*height;
y1 = yBottom + h1*height;
r0 = radiusBottom + h0*(radiusTop-radiusBottom);
r1 = radiusBottom + h1*(radiusTop-radiusBottom);
a0 = FLOAT_2PI*(float)i/sideSubdiv;
a1 = FLOAT_2PI*(float)(i+1)/sideSubdiv;
cosa0 = (float)cos(a0);
sina0 = (float)sin(a0);
cosa1 = (float)cos(a1);
sina1 = (float)sin(a1);
glNormal3f(cosa0, 0, sina0);
glVertex3f(xCenter+r0*cosa0, y0, zCenter+r0*sina0);
glNormal3f(cosa0, 0, sina0);
glVertex3f(xCenter+r1*cosa0, y1, zCenter+r1*sina0);
glNormal3f(cosa1, 0, sina1);
glVertex3f(xCenter+r1*cosa1, y1, zCenter+r1*sina1);
glNormal3f(cosa1, 0, sina1);
glVertex3f(xCenter+r0*cosa1, y0, zCenter+r0*sina1);
}
glEnd();
}
// Subroutine used to build halo display list
void Scene::DrawSubdivHaloZ(float x, float y, float z, float radius, int subdiv)
{
glBegin(GL_TRIANGLE_FAN);
glNormal3f(0, 0, 0);
glColor4f(1, 1, 1, 1);
glVertex3f(x, y, z);
for( int i=0; i<=subdiv; ++i )
{
glColor4f(1, 1, 1, 0);
glVertex3f(x+radius*(float)cos(FLOAT_2PI*(float)i/subdiv), x+radius*(float)sin(FLOAT_2PI*(float)i/subdiv), z);
}
glEnd();
}
// Callback function called by GLFW when a mouse button is clicked
void GLFWCALL OnMouseButton(int glfwButton, int glfwAction)
{
if( !TwEventMouseButtonGLFW(glfwButton, glfwAction) ) // Send event to AntTweakBar
{
// Event has not been handled by AntTweakBar
// Do something if needed.
}
}
// Callback function called by GLFW when mouse has moved
void GLFWCALL OnMousePos(int mouseX, int mouseY)
{
if( !TwEventMousePosGLFW(mouseX, mouseY) ) // Send event to AntTweakBar
{
// Event has not been handled by AntTweakBar
// Do something if needed.
}
}
// Callback function called by GLFW on mouse wheel event
void GLFWCALL OnMouseWheel(int pos)
{
if( !TwEventMouseWheelGLFW(pos) ) // Send event to AntTweakBar
{
// Event has not been handled by AntTweakBar
// Do something if needed.
}
}
// Callback function called by GLFW on key event
void GLFWCALL OnKey(int glfwKey, int glfwAction)
{
if( !TwEventKeyGLFW(glfwKey, glfwAction) ) // Send event to AntTweakBar
{
// Event has not been handled by AntTweakBar
// Do something if needed.
}
}
// Callback function called by GLFW on char event
void GLFWCALL OnChar(int glfwChar, int glfwAction)
{
if( !TwEventCharGLFW(glfwChar, glfwAction) ) // Send event to AntTweakBar
{
// Event has not been handled by AntTweakBar
// Do something if needed.
}
}
// Callback function called by GLFW when window size changes
void GLFWCALL OnWindowSize(int width, int height)
{
// Set OpenGL viewport and camera
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(40, (double)width/height, 1, 10);
gluLookAt(-0.3,1,3.5, -0.3,0,0, 0,1,0);
glTranslated(0, -0.3, 0);
// Send the new window size to AntTweakBar
TwWindowSize(width, height);
}
// Callback function called when the 'Subdiv' variable value of the main tweak bar has changed.
void TW_CALL SetSubdivCB(const void *value, void *clientData)
{
Scene *scene = static_cast<Scene *>(clientData); // scene pointer is stored in clientData
scene->Subdiv = *static_cast<const int *>(value); // copy value to scene->Subdiv
scene->Init(false); // re-init scene with the new Subdiv parameter
}
// Callback function called by the main tweak bar to get the 'Subdiv' value
void TW_CALL GetSubdivCB(void *value, void *clientData)
{
Scene *scene = static_cast<Scene *>(clientData); // scene pointer is stored in clientData
*static_cast<int *>(value) = scene->Subdiv; // copy scene->Subdiv to value
}
// Main function
int main()
{
// Intialize GLFW
if( !glfwInit() )
{
// A fatal error occured
std::cerr << "GLFW initialization failed" << std::endl;
return 1;
}
// Create a window
GLFWvidmode mode;
glfwGetDesktopMode(&mode);
if( !glfwOpenWindow(800, 600, mode.RedBits, mode.GreenBits, mode.BlueBits, 0, 16, 0, GLFW_WINDOW /* or GLFW_FULLSCREEN */) )
{
// A fatal error occured
std::cerr << "Cannot open GLFW window" << std::endl;
glfwTerminate();
return 1;
}
glfwEnable(GLFW_MOUSE_CURSOR);
glfwEnable(GLFW_KEY_REPEAT);
glfwSetWindowTitle("AntTweakBar example: TwAdvanced1");
// Set GLFW event callbacks
glfwSetWindowSizeCallback(OnWindowSize);
glfwSetMouseButtonCallback(OnMouseButton);
glfwSetMousePosCallback(OnMousePos);
glfwSetMouseWheelCallback(OnMouseWheel);
glfwSetKeyCallback(OnKey);
glfwSetCharCallback(OnChar);
// Initialize AntTweakBar
if( !TwInit(TW_OPENGL, NULL) )
{
// A fatal error occured
std::cerr << "AntTweakBar initialization failed: " << TwGetLastError() << std::endl;
glfwTerminate();
return 1;
}
// Initialize the 3D scene
Scene scene;
scene.Init(true);
// Create a tweak bar called 'Main' and change its refresh rate and font size
TwBar *mainBar = TwNewBar("Main");
TwDefine(" Main label='Main TweakBar' refresh=0.5 fontSize=3 ");
// Add some variables to the Main tweak bar
TwAddVarRW(mainBar, "Wireframe", TW_TYPE_BOOLCPP, &scene.Wireframe, " group='Display' key=w "); // 'Wireframe' is put in the group 'Display' (which is then created)
TwAddVarRW(mainBar, "BgTop", TW_TYPE_COLOR3F, &scene.BgColor1, " group='Background' "); // 'BgTop' and 'BgBottom' are put in the group 'Background' (which is then created)
TwAddVarRW(mainBar, "BgBottom", TW_TYPE_COLOR3F, &scene.BgColor0, " group='Background' ");
TwDefine(" Main/Background group='Display' "); // The group 'Background' of bar 'Main' is put in the group 'Display'
TwAddVarCB(mainBar, "Subdiv", TW_TYPE_INT32, SetSubdivCB, GetSubdivCB, &scene, " group='Scene' label='Meshs subdivision' min=1 max=50 keyincr=s keyDecr=S ");
TwAddVarRW(mainBar, "Ambient", TW_TYPE_FLOAT, &scene.Ambient, " label='Ambient factor' group='Scene' min=0 max=1 step=0.001 keyIncr=a keyDecr=A ");
TwAddVarRW(mainBar, "Reflection", TW_TYPE_FLOAT, &scene.Reflection, " label='Reflection factor' group='Scene' min=0 max=1 step=0.001 keyIncr=r keyDecr=R ");
// Create a new TwType called rotationType associated with the Scene::RotMode enum, and use it
TwEnumVal rotationEV[] = { { Scene::ROT_OFF, "Stopped"}, { Scene::ROT_CW, "Clockwise" }, { Scene::ROT_CCW, "Counter-clockwise" } };
TwType rotationType = TwDefineEnum( "Rotation Mode", rotationEV, 3 );
TwAddVarRW(mainBar, "Rotation", rotationType, &scene.Rotation, " group='Scene' keyIncr=Backspace keyDecr=SHIFT+Backspace ");
// Add a read-only float variable; its precision is 0 which means that the fractionnal part of the float value will not be displayed
TwAddVarRO(mainBar, "RotYAngle", TW_TYPE_FLOAT, &scene.RotYAngle, " group='Scene' label='Rot angle (degree)' precision=0 ");
// Initialize time
float time = (float)glfwGetTime(), dt = 0; // Current time and elapsed time
// Main loop (repeated while window is not closed and [ESC] is not pressed)
while( glfwGetWindowParam(GLFW_OPENED) && !glfwGetKey(GLFW_KEY_ESC) )
{
// Compute elapsed time
dt = (float)glfwGetTime() - time;
if( dt>0.1f )
dt = 0.1f;
time += dt;
// Rotate scene
if( scene.Rotation==Scene::ROT_CW )
scene.RotYAngle -= 5.0f*dt;
else if( scene.Rotation==Scene::ROT_CCW )
scene.RotYAngle += 5.0f*dt;
// Move lights
scene.Update(time);
// Draw scene
scene.Draw();
// Draw tweak bars
TwDraw();
// Present frame buffer
glfwSwapBuffers();
}
// Terminate AntTweakBar and GLFW
TwTerminate();
glfwTerminate();
return 0;
}

View File

@@ -1,142 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="TwAdvanced1"
ProjectGUID="{008D1CEC-1586-4C89-B524-DF15D9605163}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="debug"
IntermediateDirectory="debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glfwdll.lib opengl32.lib glu32.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib/debug,../lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="if exist c:\sdk\glfw\lib\win32\glfw.dll xcopy /y /f c:\sdk\glfw\lib\win32\glfw.dll debug
if exist ..\lib\AntTweakBar.dll xcopy /y /f ..\lib\AntTweakBar.dll debug
if exist ..\lib\debug\AntTweakBar.dll xcopy /y /f ..\lib\debug\AntTweakBar.dll debug
"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="bin"
IntermediateDirectory="bin"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="0"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glfwdll.lib opengl32.lib glu32.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="FALSE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
SetChecksum="TRUE"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="if exist c:\sdk\glfw\lib\win32\glfw.dll xcopy /y /f c:\sdk\glfw\lib\win32\glfw.dll bin
if exist ..\lib\AntTweakBar.dll xcopy /y /f ..\lib\AntTweakBar.dll bin
"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="TwAdvanced1.cpp">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,53 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="TwCopyDLL"
ProjectGUID="{AB180E0E-0EFA-4AD4-8F08-4492D144D963}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="debug"
IntermediateDirectory="debug"
ConfigurationType="10"
CharacterSet="2">
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"
CommandLine="if exist ..\lib\debug\AntTweakBar.dll ( xcopy /y /f ..\lib\debug\AntTweakBar.dll debug ) else ( xcopy /y /f ..\lib\AntTweakBar.dll debug )
"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="bin"
IntermediateDirectory="bin"
ConfigurationType="10"
CharacterSet="2">
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy /y /f ..\lib\AntTweakBar.dll bin"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,228 +0,0 @@
// ---------------------------------------------------------------------------
//
// @file TwSimpleDX9.c
// @brief A simple example that uses AntTweakBar with DirectX9
//
// AntTweakBar: http://www.antisphere.com/Wiki/tools:anttweakbar
// DirectX: http://msdn.microsoft.com/directx
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/20
//
// note: TAB=4
//
// Compilation:
// http://www.antisphere.com/Wiki/tools:anttweakbar:examples#twsimpledx9
//
// ---------------------------------------------------------------------------
#include <AntTweakBar.h>
#include <d3d9.h>
#include <dxerr9.h>
#include <math.h>
// Direct3D structures
IDirect3D9 * g_D3D = NULL;
IDirect3DDevice9 * g_D3DDev = NULL;
D3DPRESENT_PARAMETERS g_D3Dpp;
// D3D states initialization function
void InitD3D()
{
// Set D3D matrices
D3DMATRIX matId = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };
g_D3DDev->SetTransform(D3DTS_WORLD, &matId);
g_D3DDev->SetTransform(D3DTS_VIEW, &matId);
D3DMATRIX matProj = { (float)g_D3Dpp.BackBufferHeight/g_D3Dpp.BackBufferWidth,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };
g_D3DDev->SetTransform(D3DTS_PROJECTION, &matProj);
// Disable lighting and culling
g_D3DDev->SetRenderState( D3DRS_LIGHTING, FALSE );
g_D3DDev->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
}
// Win32 MessageProc callback
LRESULT CALLBACK MessageProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Send event message to AntTweakBar
if( TwEventWin32(wnd, msg, wParam, lParam) )
return 0; // Event has been handled by AntTweakBar
switch( msg )
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_SIZE: // Window size has been changed
// reset D3D device
if( g_D3DDev )
{
g_D3Dpp.BackBufferWidth = LOWORD(lParam);
g_D3Dpp.BackBufferHeight = HIWORD(lParam);
if( g_D3Dpp.BackBufferWidth>0 && g_D3Dpp.BackBufferHeight>0 )
{
g_D3DDev->Reset(&g_D3Dpp);
InitD3D(); // re-initialize D3D states
}
// TwWindowSize has been called by TwEventWin32, so it is not necessary to call it again here.
}
return 0;
default:
return DefWindowProc(wnd, msg, wParam, lParam);
}
}
// Main
int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow)
{
// Register our window class
WNDCLASSEX wcex = { sizeof(WNDCLASSEX), CS_CLASSDC, MessageProc, 0L, 0L, instance, NULL, NULL, NULL, NULL, "TwDX9", NULL };
RegisterClassEx(&wcex);
// Create a window
RECT rect = { 0, 0, 640, 480 };
AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE);
HWND wnd = CreateWindow("TwDX9", "AntTweakBar simple example using DirectX9", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, rect.right-rect.left, rect.bottom-rect.top, NULL, NULL, instance, NULL);
if( !wnd )
{
MessageBox(NULL, "Cannot create window", "Error", MB_OK|MB_ICONERROR);
return FALSE;
}
ShowWindow(wnd, cmdShow);
UpdateWindow(wnd);
// Initialize Direct3D
g_D3D = Direct3DCreate9(D3D_SDK_VERSION);
if( !g_D3D )
{
MessageBox(wnd, "Cannot initialize DirectX", "Error", MB_OK|MB_ICONERROR);
return FALSE;
}
// Create a Direct3D device
ZeroMemory( &g_D3Dpp, sizeof(D3DPRESENT_PARAMETERS) );
g_D3Dpp.Windowed = TRUE;
g_D3Dpp.BackBufferCount = 1;
g_D3Dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
g_D3Dpp.BackBufferFormat = D3DFMT_UNKNOWN;
g_D3Dpp.EnableAutoDepthStencil = TRUE;
g_D3Dpp.AutoDepthStencilFormat = D3DFMT_D16;
g_D3Dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
HRESULT hr = g_D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &g_D3Dpp, &g_D3DDev);
if( FAILED(hr) )
{
DXTRACE_ERR_MSGBOX("Cannot create DirectX device", hr);
g_D3D->Release();
g_D3D = NULL;
return FALSE;
}
// This example draws a moving strip;
// create a buffer of vertices for the strip
struct Vertex
{
float x, y, z;
DWORD color;
};
Vertex vertices[2002];
int numSec = 100; // number of strip sections
float color[] = { 1, 0, 0 }; // strip color
unsigned int bgColor = D3DCOLOR_ARGB(255, 40, 255, 200); // background color
// Init some D3D states
InitD3D();
// Initialize AntTweakBar
// (note that the Direct3D device pointer must be passed to TwInit)
if( !TwInit(TW_DIRECT3D9, g_D3DDev) )
{
MessageBox(wnd, TwGetLastError(), "Cannot initialize AntTweakBar", MB_OK|MB_ICONERROR);
g_D3DDev->Release();
g_D3DDev = NULL;
g_D3D->Release();
g_D3D = NULL;
return FALSE;
}
// Create a tweak bar
TwBar *bar = TwNewBar("TweakBar");
// Add 'numSec' to 'bar': it is a modifiable (RW) variable of type TW_TYPE_INT32. Its shortcuts are [s] and [S].
TwAddVarRW(bar, "NumSec", TW_TYPE_INT32, &numSec, " label='Strip length' min=1 max=1000 keyIncr=s keyDecr=S ");
// Add 'color' to 'bar': it is a modifable variable of type TW_TYPE_COLOR3F (3 floats color)
TwAddVarRW(bar, "Color", TW_TYPE_COLOR3F, &color, " label='Strip color' ");
// Add 'bgColor' to 'bar': it is a modifable variable of type TW_TYPE_COLOR32 (32 bits color)
TwAddVarRW(bar, "BgColor", TW_TYPE_COLOR32, &bgColor, " label='Background color' ");
// Add 'width' and 'height' to 'bar': they are read-only (RO) variables of type TW_TYPE_INT32.
TwAddVarRO(bar, "Width", TW_TYPE_INT32, &g_D3Dpp.BackBufferWidth, " label='wnd width' ");
TwAddVarRO(bar, "Height", TW_TYPE_INT32, &g_D3Dpp.BackBufferHeight, " label='wnd height' ");
// Main loop
bool quit = false;
while( !quit )
{
// Clear screen and begin draw
g_D3DDev->Clear(0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, bgColor, 1.0f, 0);
g_D3DDev->BeginScene();
// Draw scene
float s, t = (float)GetTickCount()/1000.0f;
for( int i=0; i<=numSec; ++i ) // update vertices
{
s = (float)i/100;
vertices[2*i+0].x = 0.2f+0.5f*cosf(2.0f*s+5.0f*t);
vertices[2*i+1].x = vertices[2*i+0].x + (0.25f+0.1f*cosf(s+t));
vertices[2*i+0].y = vertices[2*i+1].y = 0.7f*(0.7f+0.3f*sinf(s+t))*sinf(1.5f*s+3.0f*t);
vertices[2*i+0].z = vertices[2*i+1].z = 0;
s = (float)i/numSec;
vertices[2*i+0].color = vertices[2*i+1].color = D3DCOLOR_XRGB((int)(255*color[0]*s), (int)(255*color[1]*s), (int)(255*color[2]*s));
}
g_D3DDev->SetFVF(D3DFVF_XYZ|D3DFVF_DIFFUSE);
g_D3DDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2*numSec, vertices, sizeof(Vertex)); // draw strip
// Draw tweak bars
TwDraw();
// End draw
g_D3DDev->EndScene();
// Present frame buffer
g_D3DDev->Present(NULL, NULL, NULL, NULL);
// Process windows messages
MSG msg;
while( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
{
if( msg.message==WM_QUIT )
quit = true;
else if( !TranslateAccelerator(msg.hwnd, NULL, &msg) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
} // End of main loop
// Terminate AntTweakBar
TwTerminate();
// Release Direct3D
g_D3DDev->Release();
g_D3DDev = NULL;
g_D3D->Release();
g_D3D = NULL;
return 0;
}

View File

@@ -1,138 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="TwSimpleDX9"
ProjectGUID="{6B414E54-701C-4ED3-9034-F5CD7BFC3451}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="debug"
IntermediateDirectory="debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="d3d9.lib dxerr9.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib/debug,../lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="bin"
IntermediateDirectory="bin"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="0"
CompileAs="2"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="d3d9.lib dxerr9.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="FALSE"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
SetChecksum="TRUE"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="TwSimpleDX9.cpp">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,200 +0,0 @@
// ---------------------------------------------------------------------------
//
// @file TwSimpleGLFW.c
// @brief A simple example that uses AntTweakBar with
// OpenGL and the GLFW windowing system.
//
// AntTweakBar: http://www.antisphere.com/Wiki/tools:anttweakbar
// OpenGL: http://www.opengl.org
// GLFW: http://glfw.sourceforge.net
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/20
//
// note: TAB=4
//
// Compilation:
// http://www.antisphere.com/Wiki/tools:anttweakbar:examples#twsimpleglfw
//
// ---------------------------------------------------------------------------
#include <AntTweakBar.h>
#define GLFW_DLL
#include "glfw.h"
#include <stdio.h>
// Callback function called by GLFW when window size changes
void GLFWCALL WindowSizeCB(int width, int height)
{
// Set OpenGL viewport and camera
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(40, (double)width/height, 1, 10);
gluLookAt(-1,0,3, 0,0,0, 0,1,0);
// Send the new window size to AntTweakBar
TwWindowSize(width, height);
}
// This example program draws a possibly transparent cube
void DrawModel(int wireframe)
{
int pass, numPass;
// Enable OpenGL transparency and light (could have been done once at init)
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHT0); // use default light diffuse and position
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glEnable(GL_LINE_SMOOTH);
glLineWidth(3.0);
if( wireframe )
{
glDisable(GL_CULL_FACE);
glDisable(GL_LIGHTING);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
numPass = 1;
}
else
{
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
numPass = 2;
}
for( pass=0; pass<numPass; ++pass )
{
// Since the material could be transparent, we draw the convex model in 2 passes:
// first its back faces, and second its front faces.
glCullFace( (pass==0) ? GL_FRONT : GL_BACK );
// Draw the model (a cube)
glBegin(GL_QUADS);
glNormal3f(0,0,-1); glVertex3f(0,0,0); glVertex3f(0,1,0); glVertex3f(1,1,0); glVertex3f(1,0,0); // front face
glNormal3f(0,0,+1); glVertex3f(0,0,1); glVertex3f(1,0,1); glVertex3f(1,1,1); glVertex3f(0,1,1); // back face
glNormal3f(-1,0,0); glVertex3f(0,0,0); glVertex3f(0,0,1); glVertex3f(0,1,1); glVertex3f(0,1,0); // left face
glNormal3f(+1,0,0); glVertex3f(1,0,0); glVertex3f(1,1,0); glVertex3f(1,1,1); glVertex3f(1,0,1); // right face
glNormal3f(0,-1,0); glVertex3f(0,0,0); glVertex3f(1,0,0); glVertex3f(1,0,1); glVertex3f(0,0,1); // bottom face
glNormal3f(0,+1,0); glVertex3f(0,1,0); glVertex3f(0,1,1); glVertex3f(1,1,1); glVertex3f(1,1,0); // top face
glEnd();
}
}
// Main
int main()
{
GLFWvidmode mode; // GLFW video mode
TwBar *bar; // Pointer to a tweak bar
double time = 0, dt;// Current time and enlapsed time
double turn = 0; // Model turn counter
double speed = 0.1; // Model rotation speed
int wire = 0; // Draw model in wireframe?
float bgColor[] = { 0.1f, 0.2f, 0.4f }; // Background color
unsigned char cubeColor[] = { 255, 0, 0, 255 }; // Model color (32bits RGBA)
// Intialize GLFW
if( !glfwInit() )
{
// A fatal error occured
fprintf(stderr, "GLFW initialization failed\n");
return 1;
}
// Create a window
glfwGetDesktopMode(&mode);
if( !glfwOpenWindow(640, 480, mode.RedBits, mode.GreenBits, mode.BlueBits, 0, 16, 0, GLFW_WINDOW /* or GLFW_FULLSCREEN */) )
{
// A fatal error occured
fprintf(stderr, "Cannot open GLFW window\n");
glfwTerminate();
return 1;
}
glfwEnable(GLFW_MOUSE_CURSOR);
glfwEnable(GLFW_KEY_REPEAT);
glfwSetWindowTitle("AntTweakBar simple example using GLFW");
// Initialize AntTweakBar
if( !TwInit(TW_OPENGL, NULL) )
{
// A fatal error occured
fprintf(stderr, "AntTweakBar initialization failed: %s\n", TwGetLastError());
glfwTerminate();
return 1;
}
// Create a tweak bar
bar = TwNewBar("TweakBar");
// Add 'speed' to 'bar': it is a modifable (RW) variable of type TW_TYPE_DOUBLE. Its key shortcuts are [s] and [S].
TwAddVarRW(bar, "speed", TW_TYPE_DOUBLE, &speed, " label='Rot speed (tr/sec)' min=0 max=2 step=0.01 keyIncr=s keyDecr=S ");
// Add 'wire' to 'bar': it is a modifable variable of type TW_TYPE_BOOL32 (32 bits boolean). Its key shortcut is [w].
TwAddVarRW(bar, "wire", TW_TYPE_BOOL32, &wire, " label='Wireframe mode' key=w ");
// Add 'time' to 'bar': it is a read-only (RO) variable of type TW_TYPE_DOUBLE, with 1 precision digit
TwAddVarRO(bar, "time", TW_TYPE_DOUBLE, &time, " label='Time (sec)' precision=1 ");
// Add 'bgColor' to 'bar': it is a modifable variable of type TW_TYPE_COLOR3F (3 floats color)
TwAddVarRW(bar, "bgColor", TW_TYPE_COLOR3F, &bgColor, " label='Background color' ");
// Add 'cubeColor' to 'bar': it is a modifable variable of type TW_TYPE_COLOR32 (32 bits color) with alpha
TwAddVarRW(bar, "cubeColor", TW_TYPE_COLOR32, &cubeColor, " label='Cube color' alpha ");
// Set GLFW event callbacks
// - Redirect window size changes to the callback function WindowSizeCB
glfwSetWindowSizeCallback(WindowSizeCB);
// - Directly redirect GLFW mouse button events to AntTweakBar
glfwSetMouseButtonCallback((GLFWmousebuttonfun)TwEventMouseButtonGLFW);
// - Directly redirect GLFW mouse position events to AntTweakBar
glfwSetMousePosCallback((GLFWmouseposfun)TwEventMousePosGLFW);
// - Directly redirect GLFW mouse wheel events to AntTweakBar
glfwSetMouseWheelCallback((GLFWmousewheelfun)TwEventMouseWheelGLFW);
// - Directly redirect GLFW key events to AntTweakBar
glfwSetKeyCallback((GLFWkeyfun)TwEventKeyGLFW);
// - Directly redirect GLFW char events to AntTweakBar
glfwSetCharCallback((GLFWcharfun)TwEventCharGLFW);
// - Redirect window size changes to the callback function WindowSizeCB
// Initialize time
time = glfwGetTime();
// Main loop (repeated while window is not closed and [ESC] is not pressed)
while( glfwGetWindowParam(GLFW_OPENED) && !glfwGetKey(GLFW_KEY_ESC) )
{
// Clear frame buffer using bgColor
glClearColor(bgColor[0], bgColor[1], bgColor[2], 1);
glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT );
// Rotate model
dt = glfwGetTime() - time;
time += dt;
turn += speed*dt;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotated(360.0*turn, 0.4, 1, 0.2);
glTranslated(-0.5, -0.5, -0.5);
// Set color and draw model
glColor4ubv(cubeColor);
DrawModel(wire);
// Draw tweak bars
TwDraw();
// Present frame buffer
glfwSwapBuffers();
}
// Terminate AntTweakBar and GLFW
TwTerminate();
glfwTerminate();
return 0;
}

View File

@@ -1,137 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="TwSimpleGLFW"
ProjectGUID="{29C096AF-172E-4A36-A1FE-E15B259D6834}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="debug"
IntermediateDirectory="debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"
CompileAs="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glfwdll.lib opengl32.lib glu32.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib/debug,../lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="if exist c:\sdk\glfw\lib\win32\glfw.dll xcopy /y /f c:\sdk\glfw\lib\win32\glfw.dll debug"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="bin"
IntermediateDirectory="bin"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories="../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="0"
CompileAs="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glfwdll.lib opengl32.lib glu32.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="../lib"
GenerateDebugInformation="FALSE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
SetChecksum="TRUE"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="if exist c:\sdk\glfw\lib\win32\glfw.dll xcopy /y /f c:\sdk\glfw\lib\win32\glfw.dll bin"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="TwSimpleGLFW.c">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,194 +0,0 @@
// ---------------------------------------------------------------------------
//
// @file TwSimpleGLUT.c
// @brief A simple example that uses AntTweakBar with OpenGL and GLUT.
//
// AntTweakBar: http://www.antisphere.com/Wiki/tools:anttweakbar
// OpenGL: http://www.opengl.org
// GLUT: http://opengl.org/resources/libraries/glut
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/20
//
// note: TAB=4
//
// Compilation:
// http://www.antisphere.com/Wiki/tools:anttweakbar:examples#twsimpleglut
//
// ---------------------------------------------------------------------------
#include <AntTweakBar.h>
#include <stdlib.h>
#include <stdio.h>
#include <GL/glut.h>
// This example displays one of the following shapes
typedef enum { SHAPE_TEAPOT=1, SHAPE_TORUS, SHAPE_CONE } Shape;
#define NUM_SHAPES 3
Shape g_CurrentShape = SHAPE_TORUS;
// Shapes scale
float g_Zoom = 1.0f;
// Shapes material
float g_MatAmbient[] = { 0.5f, 0.0f, 0.0f, 1.0f };
float g_MatDiffuse[] = { 1.0f, 1.0f, 0.0f, 1.0f };
// Light parameter
float g_LightMultiplier = 1.0f;
// Callback function called by GLUT to render screen
void Display(void)
{
float angle = (float)glutGet(GLUT_ELAPSED_TIME)/10.0f;
float v[4]; // will be used to set light paramters
// Clear frame buffer
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
glEnable(GL_NORMALIZE);
// Set light
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
v[0] = v[1] = v[2] = g_LightMultiplier*0.4f; v[3] = 1.0f;
glLightfv(GL_LIGHT0, GL_AMBIENT, v);
v[0] = v[1] = v[2] = g_LightMultiplier*0.8f; v[3] = 1.0f;
glLightfv(GL_LIGHT0, GL_DIFFUSE, v);
v[0] = v[1] = v[2] = 1.0f; v[3] = 0.0f;
glLightfv(GL_LIGHT0, GL_POSITION, v);
// Set material
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, g_MatAmbient);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, g_MatDiffuse);
// Rotate and draw shape
glPushMatrix();
glTranslatef(0.5f, -0.3f, 0.0f);
glRotatef(angle, 1.0f, 5.0f, 0.0f);
glScalef(g_Zoom, g_Zoom, g_Zoom);
glCallList(g_CurrentShape);
glPopMatrix();
// Draw tweak bars
TwDraw();
// Present frame buffer
glutSwapBuffers();
// Recall Display at next frame
glutPostRedisplay();
}
// Callback function called by GLUT when window size changes
void Reshape(int width, int height)
{
// Set OpenGL viewport and camera
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(40, (double)width/height, 1, 10);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0,0,5, 0,0,0, 0,1,0);
glTranslatef(0, 0.6f, -1);
// Send the new window size to AntTweakBar
TwWindowSize(width, height);
}
// Function called at exit
void Terminate(void)
{
glDeleteLists(SHAPE_TEAPOT, NUM_SHAPES);
TwTerminate();
}
// Main
int main(int argc, char *argv[])
{
TwBar *bar; // Pointer to a tweak bar
// Initialize AntTweakBar
// (note that AntTweakBar could also be intialize after GLUT, no matter)
if( !TwInit(TW_OPENGL, NULL) )
{
// A fatal error occured
fprintf(stderr, "AntTweakBar initialization failed: %s\n", TwGetLastError());
return 1;
}
// Initialize GLUT
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(640, 480);
glutCreateWindow("AntTweakBar simple example using GLUT");
glutCreateMenu(NULL);
// Set GLUT callbacks
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
atexit(Terminate); // Called after glutMainLoop ends
// Set GLUT event callbacks
// - Directly redirect GLUT mouse button events to AntTweakBar
glutMouseFunc((GLUTmousebuttonfun)TwEventMouseButtonGLUT);
// - Directly redirect GLUT mouse motion events to AntTweakBar
glutMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
// - Directly redirect GLUT mouse "passive" motion events to AntTweakBar (same as MouseMotion)
glutPassiveMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
// - Directly redirect GLUT key events to AntTweakBar
glutKeyboardFunc((GLUTkeyboardfun)TwEventKeyboardGLUT);
// - Directly redirect GLUT special key events to AntTweakBar
glutSpecialFunc((GLUTspecialfun)TwEventSpecialGLUT);
// - Send 'glutGetModifers' function pointer to AntTweakBar;
// required because the GLUT key event functions do not report key modifiers states.
TwGLUTModifiersFunc(glutGetModifiers);
// Create some 3D objects (stored in display lists)
glNewList(SHAPE_TEAPOT, GL_COMPILE);
glutSolidTeapot(1.0);
glEndList();
glNewList(SHAPE_TORUS, GL_COMPILE);
glutSolidTorus(0.3, 1.0, 16, 32);
glEndList();
glNewList(SHAPE_CONE, GL_COMPILE);
glutSolidCone(1.0, 1.5, 64, 4);
glEndList();
// Create a tweak bar
bar = TwNewBar("TweakBar");
// Add 'g_Zoom' to 'bar': it is a modifable (RW) variable of type TW_TYPE_FLOAT. Its key shortcuts are [z] and [Z].
TwAddVarRW(bar, "Zoom", TW_TYPE_FLOAT, &g_Zoom, " min=0.01 max=2.5 step=0.01 keyIncr=z keyDecr=Z ");
// Add 'g_LightMultiplier' to 'bar': it is a variable of type TW_TYPE_FLOAT. Its key shortcuts are [+] and [-].
TwAddVarRW(bar, "Multiplier", TW_TYPE_FLOAT, &g_LightMultiplier, " label='Light booster' min=0.1 max=4 step=0.02 keyIncr='+' keyDecr='-' ");
// Add 'g_MatAmbient' to 'bar': it is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored). It is inserted into a group named 'Material'.
TwAddVarRW(bar, "Ambient", TW_TYPE_COLOR3F, &g_MatAmbient, " group='Material' ");
// Add 'g_MatDiffuse' to 'bar': it is a variable of type TW_TYPE_COLOR3F (3 floats color, alpha is ignored). It is inserted into group 'Material'.
TwAddVarRW(bar, "Diffuse", TW_TYPE_COLOR3F, &g_MatDiffuse, " group='Material' ");
// Add the enum variable 'g_CurrentShape' to 'bar'
// (before adding an enum variable, its enum type must be declared to AntTweakBar as follow)
{
// ShapeEV associates Shape enum values with labels that will be displayed instead of enum values
TwEnumVal shapeEV[NUM_SHAPES] = { {SHAPE_TEAPOT, "Teapot"}, {SHAPE_TORUS, "Torus"}, {SHAPE_CONE, "Cone"} };
// Create a type for the enum shapeEV
TwType shapeType = TwDefineEnum("ShapeType", shapeEV, NUM_SHAPES);
// add 'g_CurrentShape' to 'bar': it is a variable of type ShapeType. Its key shortcuts are [<] and [>].
TwAddVarRW(bar, "Shape", shapeType, &g_CurrentShape, " keyIncr='<' keyDecr='>' ");
}
// Call the GLUT main loop
glutMainLoop();
return 0;
}

View File

@@ -1,141 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="TwSimpleGLUT"
ProjectGUID="{CC6C3AFD-5DD9-498F-9184-C53E663C2ABF}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="debug"
IntermediateDirectory="debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;C:\SDK\glut"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"
CompileAs="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib/debug;../lib;C:\SDK\glut\lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/$(InputName).pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="if exist c:\sdk\glut\lib\glut32.dll xcopy /y /f c:\sdk\glut\lib\glut32.dll debug"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="bin"
IntermediateDirectory="bin"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories="../include;C:\SDK\glut"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
DisableLanguageExtensions="FALSE"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)/"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="0"
CompileAs="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib;C:\SDK\glut\lib"
GenerateDebugInformation="FALSE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
SetChecksum="TRUE"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="if exist c:\sdk\glut\lib\glut32.dll xcopy /y /f c:\sdk\glut\lib\glut32.dll bin"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="TwSimpleGLUT.c">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,216 +0,0 @@
// ---------------------------------------------------------------------------
//
// @file TwSimpleSDL.c
// @brief A simple example that uses AntTweakBar with OpenGL and SDL.
//
// AntTweakBar: http://www.antisphere.com/Wiki/tools:anttweakbar
// OpenGL: http://www.opengl.org
// SDL: http://www.libsdl.org
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/20
//
// note: TAB=4
//
// Compilation:
// http://www.antisphere.com/Wiki/tools:anttweakbar:examples#twsimplesdl
//
// ---------------------------------------------------------------------------
#include <AntTweakBar.h>
#include <SDL/SDL.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#ifdef _WIN32
# include <windows.h> // required by gl.h
#endif
#include <GL/gl.h>
#include <GL/glu.h>
// SDL redefines main
#ifdef main
# undef main
#endif
int main()
{
const SDL_VideoInfo* video = NULL;
int width = 640, height = 480;
int bpp, flags;
int quit = 0;
TwBar *bar;
int n, numCubes = 30;
float color0[] = { 1.0f, 0.5f, 0.0f };
float color1[] = { 0.5f, 1.0f, 0.0f };
double ka = 5.3, kb = 1.7, kc = 4.1;
// Initialize SDL, then get the current video mode and use it to create a SDL window.
if( SDL_Init(SDL_INIT_VIDEO)<0 )
{
fprintf(stderr, "Video initialization failed: %s\n", SDL_GetError());
SDL_Quit();
exit(1);
}
video = SDL_GetVideoInfo();
if( !video )
{
fprintf(stderr, "Video query failed: %s\n", SDL_GetError());
SDL_Quit();
exit(1);
}
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
//SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
bpp = video->vfmt->BitsPerPixel;
flags = SDL_OPENGL | SDL_HWSURFACE | SDL_RESIZABLE;
//flags |= SDL_FULLSCREEN;
if( !SDL_SetVideoMode(width, height, bpp, flags) )
{
fprintf(stderr, "Video mode set failed: %s", SDL_GetError());
SDL_Quit();
exit(1);
}
SDL_WM_SetCaption("AntTweakBar simple example using SDL", "AntTweakBar+SDL");
// Enable SDL unicode and key-repeat
SDL_EnableUNICODE(1);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
// Set OpenGL viewport and states
glViewport(0, 0, width, height);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0); // use default light diffuse and position
glEnable(GL_NORMALIZE);
glEnable(GL_COLOR_MATERIAL);
glDisable(GL_CULL_FACE);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
// Initialize AntTweakBar
TwInit(TW_OPENGL, NULL);
// Tell the window size to AntTweakBar
TwWindowSize(width, height);
// Create a tweak bar
bar = TwNewBar("TweakBar");
// Add 'width' and 'height' to 'bar': they are read-only (RO) variables of type TW_TYPE_INT32.
TwAddVarRO(bar, "Width", TW_TYPE_INT32, &width, " label='Wnd width (pixels)' ");
TwAddVarRO(bar, "Height", TW_TYPE_INT32, &height, " label='Wnd height (pixels)' ");
// Add 'quit' to 'bar': it is a modifiable (RW) variable of type TW_TYPE_BOOL32 (boolean stored in a 32 bits integer). Its shortcut is [ESC].
TwAddVarRW(bar, "Quit", TW_TYPE_BOOL32, &quit, " label='Quit?' true='+' false='-' key='ESC' ");
// Add 'numCurves' to 'bar': it is a modifiable variable of type TW_TYPE_INT32. Its shortcuts are [c] and [C].
TwAddVarRW(bar, "NumCubes", TW_TYPE_INT32, &numCubes, " label='Number of cubes' min=1 max=100 keyIncr=c keyDecr=C ");
// Add 'ka', 'kb and 'kc' to 'bar': they are modifiable variables of type TW_TYPE_DOUBLE
TwAddVarRW(bar, "ka", TW_TYPE_DOUBLE, &ka, " label='X path coeff' keyIncr=1 keyDecr=CTRL+1 min=-10 max=10 step=0.01 ");
TwAddVarRW(bar, "kb", TW_TYPE_DOUBLE, &kb, " label='Y path coeff' keyIncr=2 keyDecr=CTRL+2 min=-10 max=10 step=0.01 ");
TwAddVarRW(bar, "kc", TW_TYPE_DOUBLE, &kc, " label='Z path coeff' keyIncr=3 keyDecr=CTRL+3 min=-10 max=10 step=0.01 ");
// Add 'color0' and 'color1' to 'bar': they are modifable variables of type TW_TYPE_COLOR3F (3 floats color)
TwAddVarRW(bar, "color0", TW_TYPE_COLOR3F, &color0, " label='Start color' ");
TwAddVarRW(bar, "color1", TW_TYPE_COLOR3F, &color1, " label='End color' ");
// Main loop:
// - Draw some cubes
// - Process events
while( !quit )
{
SDL_Event event;
int handled;
// Clear screen
glClearColor(0.6f, 0.95f, 1.0f, 1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
// Set OpenGL camera
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(40, (double)width/height, 1, 10);
gluLookAt(0,0,3, 0,0,0, 0,1,0);
// Draw cubes
for( n=0; n<numCubes; ++n )
{
double t = 0.05*n - (double)SDL_GetTicks()/2000.0;
double r = 5.0*n + (double)SDL_GetTicks()/10.0;
float c = (float)n/numCubes;
// Set cube position
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslated(0.4+0.6*cos(ka*t), 0.6*cos(kb*t), 0.6*sin(kc*t));
glRotated(r, 0.2, 0.7, 0.2);
glScaled(0.1, 0.1, 0.1);
glTranslated(-0.5, -0.5, -0.5);
// Set cube color
glColor3f((1.0f-c)*color0[0]+c*color1[0], (1.0f-c)*color0[1]+c*color1[1], (1.0f-c)*color0[2]+c*color1[2]);
// Draw cube
glBegin(GL_QUADS);
glNormal3f(0,0,-1); glVertex3f(0,0,0); glVertex3f(0,1,0); glVertex3f(1,1,0); glVertex3f(1,0,0); // front face
glNormal3f(0,0,+1); glVertex3f(0,0,1); glVertex3f(1,0,1); glVertex3f(1,1,1); glVertex3f(0,1,1); // back face
glNormal3f(-1,0,0); glVertex3f(0,0,0); glVertex3f(0,0,1); glVertex3f(0,1,1); glVertex3f(0,1,0); // left face
glNormal3f(+1,0,0); glVertex3f(1,0,0); glVertex3f(1,1,0); glVertex3f(1,1,1); glVertex3f(1,0,1); // right face
glNormal3f(0,-1,0); glVertex3f(0,0,0); glVertex3f(1,0,0); glVertex3f(1,0,1); glVertex3f(0,0,1); // bottom face
glNormal3f(0,+1,0); glVertex3f(0,1,0); glVertex3f(0,1,1); glVertex3f(1,1,1); glVertex3f(1,1,0); // top face
glEnd();
}
// Draw tweak bars
TwDraw();
// Present frame buffer
SDL_GL_SwapBuffers();
// Process incoming events
while( SDL_PollEvent(&event) )
{
// Send event to AntTweakBar
handled = TwEventSDL(&event);
// If event has not been handled by AntTweakBar, process it
if( !handled )
{
switch( event.type )
{
case SDL_QUIT: // Window is closed
quit = 1;
break;
case SDL_VIDEORESIZE: // Window size has changed
// Resize SDL video mode
width = event.resize.w;
height = event.resize.h;
if( !SDL_SetVideoMode(width, height, bpp, flags) )
fprintf(stderr, "WARNING: Video mode set failed: %s", SDL_GetError());
// Resize OpenGL viewport
glViewport(0, 0, width, height);
// Restore OpenGL states (SDL seems to lost them)
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_NORMALIZE);
glEnable(GL_COLOR_MATERIAL);
glDisable(GL_CULL_FACE);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
// TwWindowSize has been called by TwEventSDL, so it is not necessary to call it again here.
break;
}
}
}
} // End of main loop
// Terminate AntTweakBar
TwTerminate();
// Terminate SDL
SDL_Quit();
return 0;
}

View File

@@ -1,178 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="TwSimpleSDL"
ProjectGUID="{3B516919-D0DA-43CE-820E-8306368F605B}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="bin"
IntermediateDirectory="bin"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2"
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories="../include;c:/sdk/sdl/include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=""
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
WarningLevel="4"
SuppressStartupBanner="TRUE"
Detect64BitPortabilityProblems="TRUE"
CompileAs="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="FALSE"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="SDL.lib opengl32.lib glu32.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib;c:/sdk/sdl/lib"
IgnoreAllDefaultLibraries="FALSE"
IgnoreDefaultLibraryNames=""
ProgramDatabaseFile=""
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
SetChecksum="TRUE"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName="$(OutDir)/TwTestSDL.tlb"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="if exist c:\sdk\sdl\lib\sdl.dll xcopy /y /f c:\sdk\sdl\lib\sdl.dll bin"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="debug"
IntermediateDirectory="debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include,c:/sdk/sdl/include"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=""
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
WarningLevel="4"
SuppressStartupBanner="TRUE"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"
CompileAs="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="SDL.lib opengl32.lib glu32.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="../lib/debug;../lib;c:/sdk/sdl/lib"
IgnoreAllDefaultLibraries="FALSE"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName="$(OutDir)/TwTestSDL.tlb"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="if exist c:\sdk\sdl\lib\sdl.dll xcopy /y /f c:\sdk\sdl\lib\sdl.dll .\debug"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="TwSimpleSDL.c">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/"/>
</FileConfiguration>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,482 +0,0 @@
//========================================================================
// GLFW - An OpenGL framework
// File: glfw.h
// API version: 2.5
// Author: Marcus Geelnard (marcus.geelnard at home.se)
// WWW: http://glfw.sourceforge.net
//------------------------------------------------------------------------
// Copyright (c) 2002-2005 Marcus Geelnard
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would
// be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//
// Marcus Geelnard
// marcus.geelnard at home.se
//------------------------------------------------------------------------
// $Id: glfw.h,v 1.16 2005/03/14 20:52:51 marcus256 Exp $
//========================================================================
#ifndef __glfw_h_
#define __glfw_h_
#ifdef __cplusplus
extern "C" {
#endif
//========================================================================
// Global definitions
//========================================================================
// We need a NULL pointer from time to time
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif // NULL
// ------------------- BEGIN SYSTEM/COMPILER SPECIFIC --------------------
// Please report any probles that you find with your compiler, which may
// be solved in this section! There are several compilers that I have not
// been able to test this file with yet.
// First: If we are we on Windows, we want a single define for it (_WIN32)
// (Note: For Cygwin the compiler flag -mwin32 should be used, but to
// make sure that things run smoothly for Cygwin users, we add __CYGWIN__
// to the list of "valid Win32 identifiers", which removes the need for
// -mwin32)
#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))
#define _WIN32
#endif // _WIN32
// In order for extension support to be portable, we need to define an
// OpenGL function call method. We use the keyword APIENTRY, which is
// defined for Win32. (Note: Windows also needs this for <GL/gl.h>)
#ifndef APIENTRY
#ifdef _WIN32
#define APIENTRY __stdcall
#else
#define APIENTRY
#endif
#define GL_APIENTRY_DEFINED
#endif // APIENTRY
// The following three defines are here solely to make some Windows-based
// <GL/gl.h> files happy. Theoretically we could include <windows.h>, but
// it has the major drawback of severely polluting our namespace.
// Under Windows, we need WINGDIAPI defined
#if !defined(WINGDIAPI) && defined(_WIN32)
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
// Microsoft Visual C++, Borland C++ Builder and Pelles C
#define WINGDIAPI __declspec(dllimport)
#elif defined(__LCC__)
// LCC-Win32
#define WINGDIAPI __stdcall
#else
// Others (e.g. MinGW, Cygwin)
#define WINGDIAPI extern
#endif
#define GL_WINGDIAPI_DEFINED
#endif // WINGDIAPI
// Some <GL/glu.h> files also need CALLBACK defined
#if !defined(CALLBACK) && defined(_WIN32)
#if defined(_MSC_VER)
// Microsoft Visual C++
#if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
#define CALLBACK __stdcall
#else
#define CALLBACK
#endif
#else
// Other Windows compilers
#define CALLBACK __stdcall
#endif
#define GLU_CALLBACK_DEFINED
#endif // CALLBACK
// Microsoft Visual C++, Borland C++ and Pelles C <GL/glu.h> needs wchar_t
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)) && !defined(_WCHAR_T_DEFINED)
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif // _WCHAR_T_DEFINED
// ---------------- GLFW related system specific defines -----------------
#if defined(_WIN32) && defined(GLFW_BUILD_DLL)
// We are building a Win32 DLL
#define GLFWAPI __declspec(dllexport)
#define GLFWAPIENTRY __stdcall
#define GLFWCALL __stdcall
#elif defined(_WIN32) && defined(GLFW_DLL)
// We are calling a Win32 DLL
#if defined(__LCC__)
#define GLFWAPI extern
#else
#define GLFWAPI __declspec(dllimport)
#endif
#define GLFWAPIENTRY __stdcall
#define GLFWCALL __stdcall
#else
// We are either building/calling a static lib or we are non-win32
#define GLFWAPIENTRY
#define GLFWAPI
#define GLFWCALL
#endif
// -------------------- END SYSTEM/COMPILER SPECIFIC ---------------------
// Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is
// convenient for the user to only have to include <GL/glfw.h>. This also
// solves the problem with Windows <GL/gl.h> and <GL/glu.h> needing some
// special defines which normally requires the user to include <windows.h>
// (which is not a nice solution for portable programs).
#if defined(__APPLE_CC__)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
//========================================================================
// GLFW version
//========================================================================
#define GLFW_VERSION_MAJOR 2
#define GLFW_VERSION_MINOR 5
#define GLFW_VERSION_REVISION 0
//========================================================================
// Input handling definitions
//========================================================================
// Key and button state/action definitions
#define GLFW_RELEASE 0
#define GLFW_PRESS 1
// Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used
// for printable keys (such as A-Z, 0-9 etc), and values above 256
// represent special (non-printable) keys (e.g. F1, Page Up etc).
#define GLFW_KEY_UNKNOWN -1
#define GLFW_KEY_SPACE 32
#define GLFW_KEY_SPECIAL 256
#define GLFW_KEY_ESC (GLFW_KEY_SPECIAL+1)
#define GLFW_KEY_F1 (GLFW_KEY_SPECIAL+2)
#define GLFW_KEY_F2 (GLFW_KEY_SPECIAL+3)
#define GLFW_KEY_F3 (GLFW_KEY_SPECIAL+4)
#define GLFW_KEY_F4 (GLFW_KEY_SPECIAL+5)
#define GLFW_KEY_F5 (GLFW_KEY_SPECIAL+6)
#define GLFW_KEY_F6 (GLFW_KEY_SPECIAL+7)
#define GLFW_KEY_F7 (GLFW_KEY_SPECIAL+8)
#define GLFW_KEY_F8 (GLFW_KEY_SPECIAL+9)
#define GLFW_KEY_F9 (GLFW_KEY_SPECIAL+10)
#define GLFW_KEY_F10 (GLFW_KEY_SPECIAL+11)
#define GLFW_KEY_F11 (GLFW_KEY_SPECIAL+12)
#define GLFW_KEY_F12 (GLFW_KEY_SPECIAL+13)
#define GLFW_KEY_F13 (GLFW_KEY_SPECIAL+14)
#define GLFW_KEY_F14 (GLFW_KEY_SPECIAL+15)
#define GLFW_KEY_F15 (GLFW_KEY_SPECIAL+16)
#define GLFW_KEY_F16 (GLFW_KEY_SPECIAL+17)
#define GLFW_KEY_F17 (GLFW_KEY_SPECIAL+18)
#define GLFW_KEY_F18 (GLFW_KEY_SPECIAL+19)
#define GLFW_KEY_F19 (GLFW_KEY_SPECIAL+20)
#define GLFW_KEY_F20 (GLFW_KEY_SPECIAL+21)
#define GLFW_KEY_F21 (GLFW_KEY_SPECIAL+22)
#define GLFW_KEY_F22 (GLFW_KEY_SPECIAL+23)
#define GLFW_KEY_F23 (GLFW_KEY_SPECIAL+24)
#define GLFW_KEY_F24 (GLFW_KEY_SPECIAL+25)
#define GLFW_KEY_F25 (GLFW_KEY_SPECIAL+26)
#define GLFW_KEY_UP (GLFW_KEY_SPECIAL+27)
#define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL+28)
#define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL+29)
#define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL+30)
#define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL+31)
#define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL+32)
#define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL+33)
#define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL+34)
#define GLFW_KEY_LALT (GLFW_KEY_SPECIAL+35)
#define GLFW_KEY_RALT (GLFW_KEY_SPECIAL+36)
#define GLFW_KEY_TAB (GLFW_KEY_SPECIAL+37)
#define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL+38)
#define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL+39)
#define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL+40)
#define GLFW_KEY_DEL (GLFW_KEY_SPECIAL+41)
#define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL+42)
#define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL+43)
#define GLFW_KEY_HOME (GLFW_KEY_SPECIAL+44)
#define GLFW_KEY_END (GLFW_KEY_SPECIAL+45)
#define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL+46)
#define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL+47)
#define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL+48)
#define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL+49)
#define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL+50)
#define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL+51)
#define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL+52)
#define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL+53)
#define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL+54)
#define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL+55)
#define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL+56)
#define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL+57)
#define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL+58)
#define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL+59)
#define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL+60)
#define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL+61)
#define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL+62)
#define GLFW_KEY_LAST GLFW_KEY_KP_ENTER
// Mouse button definitions
#define GLFW_MOUSE_BUTTON_1 0
#define GLFW_MOUSE_BUTTON_2 1
#define GLFW_MOUSE_BUTTON_3 2
#define GLFW_MOUSE_BUTTON_4 3
#define GLFW_MOUSE_BUTTON_5 4
#define GLFW_MOUSE_BUTTON_6 5
#define GLFW_MOUSE_BUTTON_7 6
#define GLFW_MOUSE_BUTTON_8 7
#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8
// Mouse button aliases
#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1
#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2
#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3
// Joystick identifiers
#define GLFW_JOYSTICK_1 0
#define GLFW_JOYSTICK_2 1
#define GLFW_JOYSTICK_3 2
#define GLFW_JOYSTICK_4 3
#define GLFW_JOYSTICK_5 4
#define GLFW_JOYSTICK_6 5
#define GLFW_JOYSTICK_7 6
#define GLFW_JOYSTICK_8 7
#define GLFW_JOYSTICK_9 8
#define GLFW_JOYSTICK_10 9
#define GLFW_JOYSTICK_11 10
#define GLFW_JOYSTICK_12 11
#define GLFW_JOYSTICK_13 12
#define GLFW_JOYSTICK_14 13
#define GLFW_JOYSTICK_15 14
#define GLFW_JOYSTICK_16 15
#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16
//========================================================================
// Other definitions
//========================================================================
// glfwOpenWindow modes
#define GLFW_WINDOW 0x00010001
#define GLFW_FULLSCREEN 0x00010002
// glfwGetWindowParam tokens
#define GLFW_OPENED 0x00020001
#define GLFW_ACTIVE 0x00020002
#define GLFW_ICONIFIED 0x00020003
#define GLFW_ACCELERATED 0x00020004
#define GLFW_RED_BITS 0x00020005
#define GLFW_GREEN_BITS 0x00020006
#define GLFW_BLUE_BITS 0x00020007
#define GLFW_ALPHA_BITS 0x00020008
#define GLFW_DEPTH_BITS 0x00020009
#define GLFW_STENCIL_BITS 0x0002000A
// The following constants are used for both glfwGetWindowParam
// and glfwOpenWindowHint
#define GLFW_REFRESH_RATE 0x0002000B
#define GLFW_ACCUM_RED_BITS 0x0002000C
#define GLFW_ACCUM_GREEN_BITS 0x0002000D
#define GLFW_ACCUM_BLUE_BITS 0x0002000E
#define GLFW_ACCUM_ALPHA_BITS 0x0002000F
#define GLFW_AUX_BUFFERS 0x00020010
#define GLFW_STEREO 0x00020011
// glfwEnable/glfwDisable tokens
#define GLFW_MOUSE_CURSOR 0x00030001
#define GLFW_STICKY_KEYS 0x00030002
#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003
#define GLFW_SYSTEM_KEYS 0x00030004
#define GLFW_KEY_REPEAT 0x00030005
#define GLFW_AUTO_POLL_EVENTS 0x00030006
// glfwWaitThread wait modes
#define GLFW_WAIT 0x00040001
#define GLFW_NOWAIT 0x00040002
// glfwGetJoystickParam tokens
#define GLFW_PRESENT 0x00050001
#define GLFW_AXES 0x00050002
#define GLFW_BUTTONS 0x00050003
// glfwReadImage/glfwLoadTexture2D flags
#define GLFW_NO_RESCALE_BIT 0x00000001 // Only for glfwReadImage
#define GLFW_ORIGIN_UL_BIT 0x00000002
#define GLFW_BUILD_MIPMAPS_BIT 0x00000004 // Only for glfwLoadTexture2D
#define GLFW_ALPHA_MAP_BIT 0x00000008
// Time spans longer than this (seconds) are considered to be infinity
#define GLFW_INFINITY 100000.0
//========================================================================
// Typedefs
//========================================================================
// The video mode structure used by glfwGetVideoModes()
typedef struct {
int Width, Height;
int RedBits, BlueBits, GreenBits;
} GLFWvidmode;
// Image/texture information
typedef struct {
int Width, Height;
int Format;
int BytesPerPixel;
unsigned char *Data;
} GLFWimage;
// Thread ID
typedef int GLFWthread;
// Mutex object
typedef void * GLFWmutex;
// Condition variable object
typedef void * GLFWcond;
// Function pointer types
typedef void (GLFWCALL * GLFWwindowsizefun)(int,int);
typedef int (GLFWCALL * GLFWwindowclosefun)(void);
typedef void (GLFWCALL * GLFWwindowrefreshfun)(void);
typedef void (GLFWCALL * GLFWmousebuttonfun)(int,int);
typedef void (GLFWCALL * GLFWmouseposfun)(int,int);
typedef void (GLFWCALL * GLFWmousewheelfun)(int);
typedef void (GLFWCALL * GLFWkeyfun)(int,int);
typedef void (GLFWCALL * GLFWcharfun)(int,int);
typedef void (GLFWCALL * GLFWthreadfun)(void *);
//========================================================================
// Prototypes
//========================================================================
// GLFW initialization, termination and version querying
GLFWAPI int GLFWAPIENTRY glfwInit( void );
GLFWAPI void GLFWAPIENTRY glfwTerminate( void );
GLFWAPI void GLFWAPIENTRY glfwGetVersion( int *major, int *minor, int *rev );
// Window handling
GLFWAPI int GLFWAPIENTRY glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode );
GLFWAPI void GLFWAPIENTRY glfwOpenWindowHint( int target, int hint );
GLFWAPI void GLFWAPIENTRY glfwCloseWindow( void );
GLFWAPI void GLFWAPIENTRY glfwSetWindowTitle( const char *title );
GLFWAPI void GLFWAPIENTRY glfwGetWindowSize( int *width, int *height );
GLFWAPI void GLFWAPIENTRY glfwSetWindowSize( int width, int height );
GLFWAPI void GLFWAPIENTRY glfwSetWindowPos( int x, int y );
GLFWAPI void GLFWAPIENTRY glfwIconifyWindow( void );
GLFWAPI void GLFWAPIENTRY glfwRestoreWindow( void );
GLFWAPI void GLFWAPIENTRY glfwSwapBuffers( void );
GLFWAPI void GLFWAPIENTRY glfwSwapInterval( int interval );
GLFWAPI int GLFWAPIENTRY glfwGetWindowParam( int param );
GLFWAPI void GLFWAPIENTRY glfwSetWindowSizeCallback( GLFWwindowsizefun cbfun );
GLFWAPI void GLFWAPIENTRY glfwSetWindowCloseCallback( GLFWwindowclosefun cbfun );
GLFWAPI void GLFWAPIENTRY glfwSetWindowRefreshCallback( GLFWwindowrefreshfun cbfun );
// Video mode functions
GLFWAPI int GLFWAPIENTRY glfwGetVideoModes( GLFWvidmode *list, int maxcount );
GLFWAPI void GLFWAPIENTRY glfwGetDesktopMode( GLFWvidmode *mode );
// Input handling
GLFWAPI void GLFWAPIENTRY glfwPollEvents( void );
GLFWAPI void GLFWAPIENTRY glfwWaitEvents( void );
GLFWAPI int GLFWAPIENTRY glfwGetKey( int key );
GLFWAPI int GLFWAPIENTRY glfwGetMouseButton( int button );
GLFWAPI void GLFWAPIENTRY glfwGetMousePos( int *xpos, int *ypos );
GLFWAPI void GLFWAPIENTRY glfwSetMousePos( int xpos, int ypos );
GLFWAPI int GLFWAPIENTRY glfwGetMouseWheel( void );
GLFWAPI void GLFWAPIENTRY glfwSetMouseWheel( int pos );
GLFWAPI void GLFWAPIENTRY glfwSetKeyCallback( GLFWkeyfun cbfun );
GLFWAPI void GLFWAPIENTRY glfwSetCharCallback( GLFWcharfun cbfun );
GLFWAPI void GLFWAPIENTRY glfwSetMouseButtonCallback( GLFWmousebuttonfun cbfun );
GLFWAPI void GLFWAPIENTRY glfwSetMousePosCallback( GLFWmouseposfun cbfun );
GLFWAPI void GLFWAPIENTRY glfwSetMouseWheelCallback( GLFWmousewheelfun cbfun );
// Joystick input
GLFWAPI int GLFWAPIENTRY glfwGetJoystickParam( int joy, int param );
GLFWAPI int GLFWAPIENTRY glfwGetJoystickPos( int joy, float *pos, int numaxes );
GLFWAPI int GLFWAPIENTRY glfwGetJoystickButtons( int joy, unsigned char *buttons, int numbuttons );
// Time
GLFWAPI double GLFWAPIENTRY glfwGetTime( void );
GLFWAPI void GLFWAPIENTRY glfwSetTime( double time );
GLFWAPI void GLFWAPIENTRY glfwSleep( double time );
// Extension support
GLFWAPI int GLFWAPIENTRY glfwExtensionSupported( const char *extension );
GLFWAPI void* GLFWAPIENTRY glfwGetProcAddress( const char *procname );
GLFWAPI void GLFWAPIENTRY glfwGetGLVersion( int *major, int *minor, int *rev );
// Threading support
GLFWAPI GLFWthread GLFWAPIENTRY glfwCreateThread( GLFWthreadfun fun, void *arg );
GLFWAPI void GLFWAPIENTRY glfwDestroyThread( GLFWthread ID );
GLFWAPI int GLFWAPIENTRY glfwWaitThread( GLFWthread ID, int waitmode );
GLFWAPI GLFWthread GLFWAPIENTRY glfwGetThreadID( void );
GLFWAPI GLFWmutex GLFWAPIENTRY glfwCreateMutex( void );
GLFWAPI void GLFWAPIENTRY glfwDestroyMutex( GLFWmutex mutex );
GLFWAPI void GLFWAPIENTRY glfwLockMutex( GLFWmutex mutex );
GLFWAPI void GLFWAPIENTRY glfwUnlockMutex( GLFWmutex mutex );
GLFWAPI GLFWcond GLFWAPIENTRY glfwCreateCond( void );
GLFWAPI void GLFWAPIENTRY glfwDestroyCond( GLFWcond cond );
GLFWAPI void GLFWAPIENTRY glfwWaitCond( GLFWcond cond, GLFWmutex mutex, double timeout );
GLFWAPI void GLFWAPIENTRY glfwSignalCond( GLFWcond cond );
GLFWAPI void GLFWAPIENTRY glfwBroadcastCond( GLFWcond cond );
GLFWAPI int GLFWAPIENTRY glfwGetNumberOfProcessors( void );
// Enable/disable functions
GLFWAPI void GLFWAPIENTRY glfwEnable( int token );
GLFWAPI void GLFWAPIENTRY glfwDisable( int token );
// Image/texture I/O support
GLFWAPI int GLFWAPIENTRY glfwReadImage( const char *name, GLFWimage *img, int flags );
GLFWAPI void GLFWAPIENTRY glfwFreeImage( GLFWimage *img );
GLFWAPI int GLFWAPIENTRY glfwLoadTexture2D( const char *name, int flags );
#ifdef __cplusplus
}
#endif
#endif // __glfw_h_

View File

@@ -1,89 +1,107 @@
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//
// @file AntTweakBar.h
//
// @brief AntTweakBar is a light and intuitive graphical user interface
// that can be readily integrated into OpenGL and DirectX
// applications in order to interactively tweak them.
// applications in order to interactively tweak parameters.
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2005/09/20
//
// @doc http://www.antisphere.com/Wiki/tools:anttweakbar
//
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// AntTweakBar is a free software released under the zlib license.
// For conditions of distribution and use, see License.txt
//
// note: TAB=4
//
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#if !defined TW_INCLUDED
#define TW_INCLUDED
#define TW_STATIC 1 //no dynamic link library (DLL) hell
#define TW_NO_LIB_PRAGMA 1 //no magic linking nonsense, thank you
#include <stddef.h>
#define TW_VERSION 104 // Version Mmm : M=Major mm=minor (e.g., 102 is version 1.02)
#define TW_VERSION 115 // Version Mmm : M=Major mm=minor (e.g., 102 is version 1.02)
#ifdef __cplusplus
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4995 4530)
# include <string>
# pragma warning(pop)
# else
# include <string>
# endif
extern "C" {
#endif // __cplusplus
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// OS specific definitions
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#ifdef _WIN32
#if (defined(_WIN32) || defined(_WIN64)) && !defined(TW_STATIC)
# define TW_CALL __stdcall
# define TW_CDECL_CALL __cdecl
# define TW_EXPORT_API __declspec(dllexport)
# define TW_IMPORT_API __declspec(dllimport)
#else
# define TW_CALL
# define TW_CDECL_CALL
# define TW_EXPORT_API
# define TW_IMPORT_API
#endif
#if defined TW_EXPORTS
# define TW_API TW_EXPORT_API
# define TW_API TW_EXPORT_API
#elif defined TW_STATIC
# define TW_API
# if defined(_MSC_VER) && !defined(TW_NO_LIB_PRAGMA)
# pragma comment(lib, "AntTweakBarStatic")
# ifdef _WIN64
# pragma comment(lib, "AntTweakBarStatic64")
# else
# pragma comment(lib, "AntTweakBarStatic")
# endif
# endif
#else
# define TW_API TW_IMPORT_API
# define TW_API TW_IMPORT_API
# if defined(_MSC_VER) && !defined(TW_NO_LIB_PRAGMA)
# pragma comment(lib, "AntTweakBar")
# ifdef _WIN64
# pragma comment(lib, "AntTweakBar64")
# else
# pragma comment(lib, "AntTweakBar")
# endif
# endif
#endif
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Bar functions and definitions
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
typedef struct CTwBar TwBar; // structure CTwBar is not exposed.
typedef struct CTwBar TwBar; // structure CTwBar is not exposed.
TW_API TwBar * TW_CALL TwNewBar(const char *name);
TW_API TwBar * TW_CALL TwNewBar(const char *barName);
TW_API int TW_CALL TwDeleteBar(TwBar *bar);
TW_API int TW_CALL TwDeleteAllBars();
TW_API int TW_CALL TwSetTopBar(const TwBar *bar);
TW_API TwBar * TW_CALL TwGetTopBar();
TW_API int TW_CALL TwSetBottomBar(const TwBar *bar);
TW_API TwBar * TW_CALL TwGetBottomBar();
TW_API const char * TW_CALL TwGetBarName(TwBar *bar);
TW_API int TW_CALL TwGetBarCount();
TW_API TwBar * TW_CALL TwGetBarByIndex(int barIndex);
TW_API TwBar * TW_CALL TwGetBarByName(const char *barName);
TW_API int TW_CALL TwRefreshBar(TwBar *bar);
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Var functions and definitions
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
typedef enum ETwType
{
@@ -103,10 +121,24 @@ typedef enum ETwType
TW_TYPE_UINT32,
TW_TYPE_FLOAT,
TW_TYPE_DOUBLE,
TW_TYPE_COLOR32, // 32 bits color. Order is RGBA if API is OpenGL, and inversed if API is DirectX (can be modified by defining 'order=...')
TW_TYPE_COLOR3F, // 3 floats color. Order is RGB.
TW_TYPE_COLOR4F, // 4 floats color. Order is RGBA.
TW_TYPE_COLOR32, // 32 bits color. Order is RGBA if API is OpenGL or Direct3D10, and inversed if API is Direct3D9 (can be modified by defining 'colorOrder=...', see doc)
TW_TYPE_COLOR3F, // 3 floats color. Order is RGB.
TW_TYPE_COLOR4F, // 4 floats color. Order is RGBA.
TW_TYPE_CDSTRING, // Null-terminated C Dynamic String (pointer to an array of char dynamically allocated with malloc/realloc/strdup)
#ifdef __cplusplus
# if defined(_MSC_VER) && (_MSC_VER > 1500)
TW_TYPE_STDSTRING = (0x2ffe0000+sizeof(std::string)), // VS2010 or higher C++ STL string (std::string)
# else
TW_TYPE_STDSTRING = (0x2fff0000+sizeof(std::string)), // C++ STL string (std::string)
# endif
#endif // __cplusplus
TW_TYPE_QUAT4F = TW_TYPE_CDSTRING+2, // 4 floats encoding a quaternion {qx,qy,qz,qs}
TW_TYPE_QUAT4D, // 4 doubles encoding a quaternion {qx,qy,qz,qs}
TW_TYPE_DIR3F, // direction vector represented by 3 floats
TW_TYPE_DIR3D // direction vector represented by 3 doubles
} TwType;
#define TW_TYPE_CSSTRING(n) ((TwType)(0x30000000+((n)&0xfffffff))) // Null-terminated C Static String of size n (defined as char[n], with n<2^28)
typedef void (TW_CALL * TwSetVarCallback)(const void *value, void *clientData);
typedef void (TW_CALL * TwGetVarCallback)(void *value, void *clientData);
typedef void (TW_CALL * TwButtonCallback)(void *clientData);
@@ -115,6 +147,7 @@ TW_API int TW_CALL TwAddVarRW(TwBar *bar, const char *name, TwType type, vo
TW_API int TW_CALL TwAddVarRO(TwBar *bar, const char *name, TwType type, const void *var, const char *def);
TW_API int TW_CALL TwAddVarCB(TwBar *bar, const char *name, TwType type, TwSetVarCallback setCallback, TwGetVarCallback getCallback, void *clientData, const char *def);
TW_API int TW_CALL TwAddButton(TwBar *bar, const char *name, TwButtonCallback callback, void *clientData, const char *def);
TW_API int TW_CALL TwAddSeparator(TwBar *bar, const char *name, const char *def);
TW_API int TW_CALL TwRemoveVar(TwBar *bar, const char *name);
TW_API int TW_CALL TwRemoveAllVars(TwBar *bar);
@@ -134,18 +167,40 @@ typedef void (TW_CALL * TwSummaryCallback)(char *summaryString, size_t summaryMa
TW_API int TW_CALL TwDefine(const char *def);
TW_API TwType TW_CALL TwDefineEnum(const char *name, const TwEnumVal *enumValues, unsigned int nbValues);
TW_API TwType TW_CALL TwDefineEnumFromString(const char *name, const char *enumString);
TW_API TwType TW_CALL TwDefineStruct(const char *name, const TwStructMember *structMembers, unsigned int nbMembers, size_t structSize, TwSummaryCallback summaryCallback, void *summaryClientData);
typedef void (TW_CALL * TwCopyCDStringToClient)(char **destinationClientStringPtr, const char *sourceString);
TW_API void TW_CALL TwCopyCDStringToClientFunc(TwCopyCDStringToClient copyCDStringFunc);
TW_API void TW_CALL TwCopyCDStringToLibrary(char **destinationLibraryStringPtr, const char *sourceClientString);
#ifdef __cplusplus
typedef void (TW_CALL * TwCopyStdStringToClient)(std::string& destinationClientString, const std::string& sourceString);
TW_API void TW_CALL TwCopyStdStringToClientFunc(TwCopyStdStringToClient copyStdStringToClientFunc);
TW_API void TW_CALL TwCopyStdStringToLibrary(std::string& destinationLibraryString, const std::string& sourceClientString);
#endif // __cplusplus
// ---------------------------------------------------------------------------
// Managment functions and definitions
// ---------------------------------------------------------------------------
typedef enum ETwParamValueType
{
TW_PARAM_INT32,
TW_PARAM_FLOAT,
TW_PARAM_DOUBLE,
TW_PARAM_CSTRING // Null-terminated array of char (ie, c-string)
} TwParamValueType;
TW_API int TW_CALL TwGetParam(TwBar *bar, const char *varName, const char *paramName, TwParamValueType paramValueType, unsigned int outValueMaxCount, void *outValues);
TW_API int TW_CALL TwSetParam(TwBar *bar, const char *varName, const char *paramName, TwParamValueType paramValueType, unsigned int inValueCount, const void *inValues);
// ----------------------------------------------------------------------------
// Management functions and definitions
// ----------------------------------------------------------------------------
typedef enum ETwGraphAPI
{
TW_OPENGL = 1,
TW_DIRECT3D9 = 2,
TW_DIRECT3D10 = 3,
TW_DIRECT3D11 = 4,
TW_OPENGL_CORE = 5
} TwGraphAPI;
TW_API int TW_CALL TwInit(TwGraphAPI graphAPI, void *device);
@@ -154,6 +209,10 @@ TW_API int TW_CALL TwTerminate();
TW_API int TW_CALL TwDraw();
TW_API int TW_CALL TwWindowSize(int width, int height);
TW_API int TW_CALL TwSetCurrentWindow(int windowID); // multi-windows support
TW_API int TW_CALL TwGetCurrentWindow();
TW_API int TW_CALL TwWindowExists(int windowID);
typedef enum ETwKeyModifier
{
TW_KMOD_NONE = 0x0000, // same codes as SDL keysym.mod
@@ -172,7 +231,7 @@ typedef enum EKeySpecial
TW_KEY_ESCAPE = 0x1b,
TW_KEY_SPACE = ' ',
TW_KEY_DELETE = 0x7f,
TW_KEY_UP = 273, // same codes and order as SDL keysym.sym
TW_KEY_UP = 273, // same codes and order as SDL 1.2 keysym.sym
TW_KEY_DOWN,
TW_KEY_RIGHT,
TW_KEY_LEFT,
@@ -200,11 +259,12 @@ typedef enum EKeySpecial
} TwKeySpecial;
TW_API int TW_CALL TwKeyPressed(int key, int modifiers);
TW_API int TW_CALL TwKeyTest(int key, int modifiers);
typedef enum ETwMouseAction
{
TW_MOUSE_RELEASED,
TW_MOUSE_PRESSED,
TW_MOUSE_PRESSED
} TwMouseAction;
typedef enum ETwMouseButtonID
{
@@ -219,35 +279,54 @@ TW_API int TW_CALL TwMouseWheel(int pos);
TW_API const char * TW_CALL TwGetLastError();
typedef void (TW_CALL * TwErrorHandler)(const char *errorMessage);
TW_API void TW_CALL TwHandleErrors(TwErrorHandler errorHandler, int breakOnError);
TW_API void TW_CALL TwHandleErrors(TwErrorHandler errorHandler);
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Helper functions to translate events from some common window management
// frameworks to AntTweakBar.
// They call TwKeyPressed, TwMouse* and TwWindowSize for you (implemented in
// files TwEventWin32.c TwEventSDL.c TwEventGLFW.c TwEventGLUT.c)
// ---------------------------------------------------------------------------
// files TwEventWin.c TwEventSDL*.c TwEventGLFW.c TwEventGLUT.c)
// ----------------------------------------------------------------------------
// For Win32 message proc
#ifndef _W64 // Microsoft specific (detection of 64 bits portability problems)
// For Windows message proc
#ifndef _W64 // Microsoft specific (detection of 64 bits portability issues)
# define _W64
#endif // _W64
TW_API int TW_CALL TwEventWin32(void *wnd, unsigned int msg, unsigned int _W64 wParam, int _W64 lParam);
#ifdef _WIN64
TW_API int TW_CALL TwEventWin(void *wnd, unsigned int msg, unsigned __int64 _W64 wParam, __int64 _W64 lParam);
#else
TW_API int TW_CALL TwEventWin(void *wnd, unsigned int msg, unsigned int _W64 wParam, int _W64 lParam);
#endif
#define TwEventWin32 TwEventWin // For compatibility with AntTweakBar versions prior to 1.11
// For libSDL event loop
TW_API int TW_CALL TwEventSDL(const void *sdlEvent);
// For GLFW event callbacks
TW_API int TW_CALL TwEventMouseButtonGLFW(int glfwButton, int glfwAction);
TW_API int TW_CALL TwEventKeyGLFW(int glfwKey, int glfwAction);
TW_API int TW_CALL TwEventCharGLFW(int glfwChar, int glfwAction);
#define TwEventMousePosGLFW TwMouseMotion
#define TwEventMouseWheelGLFW TwMouseWheel
// For libSDL event loop
TW_API int TW_CALL TwEventSDL(const void *sdlEvent, unsigned char sdlMajorVersion, unsigned char sdlMinorVersion);
// For GLUT event callbacks (calling convention for GLUT callback is cdecl for Win32)
#ifdef _WIN32
# define TW_GLUT_CALL __cdecl
// For GLFW event callbacks
// You should define GLFW_CDECL before including AntTweakBar.h if your version of GLFW uses cdecl calling convensions
#ifdef GLFW_CDECL
TW_API int TW_CDECL_CALL TwEventMouseButtonGLFWcdecl(int glfwButton, int glfwAction);
TW_API int TW_CDECL_CALL TwEventKeyGLFWcdecl(int glfwKey, int glfwAction);
TW_API int TW_CDECL_CALL TwEventCharGLFWcdecl(int glfwChar, int glfwAction);
TW_API int TW_CDECL_CALL TwEventMousePosGLFWcdecl(int mouseX, int mouseY);
TW_API int TW_CDECL_CALL TwEventMouseWheelGLFWcdecl(int wheelPos);
# define TwEventMouseButtonGLFW TwEventMouseButtonGLFWcdecl
# define TwEventKeyGLFW TwEventKeyGLFWcdecl
# define TwEventCharGLFW TwEventCharGLFWcdecl
# define TwEventMousePosGLFW TwEventMousePosGLFWcdecl
# define TwEventMouseWheelGLFW TwEventMouseWheelGLFWcdecl
#else
TW_API int TW_CALL TwEventMouseButtonGLFW(int glfwButton, int glfwAction);
TW_API int TW_CALL TwEventKeyGLFW(int glfwKey, int glfwAction);
TW_API int TW_CALL TwEventCharGLFW(int glfwChar, int glfwAction);
# define TwEventMousePosGLFW TwMouseMotion
# define TwEventMouseWheelGLFW TwMouseWheel
#endif
// For GLUT event callbacks (Windows calling convention for GLUT callbacks is cdecl)
#if defined(_WIN32) || defined(_WIN64)
# define TW_GLUT_CALL TW_CDECL_CALL
#else
# define TW_GLUT_CALL
#endif
@@ -255,27 +334,41 @@ TW_API int TW_GLUT_CALL TwEventMouseButtonGLUT(int glutButton, int glutState, in
TW_API int TW_GLUT_CALL TwEventMouseMotionGLUT(int mouseX, int mouseY);
TW_API int TW_GLUT_CALL TwEventKeyboardGLUT(unsigned char glutKey, int mouseX, int mouseY);
TW_API int TW_GLUT_CALL TwEventSpecialGLUT(int glutKey, int mouseX, int mouseY);
TW_API int TW_CALL TwGLUTModifiersFunc(int (TW_CALL *glutGetModifiersFunc)(void));
TW_API int TW_CALL TwGLUTModifiersFunc(int (TW_CALL *glutGetModifiersFunc)(void));
typedef void (TW_GLUT_CALL *GLUTmousebuttonfun)(int glutButton, int glutState, int mouseX, int mouseY);
typedef void (TW_GLUT_CALL *GLUTmousemotionfun)(int mouseX, int mouseY);
typedef void (TW_GLUT_CALL *GLUTkeyboardfun)(unsigned char glutKey, int mouseX, int mouseY);
typedef void (TW_GLUT_CALL *GLUTspecialfun)(int glutKey, int mouseX, int mouseY);
// ---------------------------------------------------------------------------
// For SFML event loop
TW_API int TW_CALL TwEventSFML(const void *sfmlEvent, unsigned char sfmlMajorVersion, unsigned char sfmlMinorVersion);
// For X11 event loop
#if defined(_UNIX)
TW_API int TW_CDECL_CALL TwEventX11(void *xevent);
#endif
// ----------------------------------------------------------------------------
// Make sure the types have the right sizes
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#define TW_COMPILE_TIME_ASSERT(name, x) typedef int TW_DUMMY_ ## name[(x) * 2 - 1]
#define TW_COMPILE_TIME_ASSERT(name, x) typedef int TW_DUMMY_ ## name[(x) * 2 - 1]
TW_COMPILE_TIME_ASSERT(CHAR, sizeof(char) == 1);
TW_COMPILE_TIME_ASSERT(SHORT, sizeof(short) == 2);
TW_COMPILE_TIME_ASSERT(INT, sizeof(int) == 4);
TW_COMPILE_TIME_ASSERT(FLOAT, sizeof(float) == 4);
TW_COMPILE_TIME_ASSERT(DOUBLE, sizeof(double) == 8);
//TW_COMPILE_TIME_ASSERT(PTR, sizeof(void*) == 4);
TW_COMPILE_TIME_ASSERT(TW_CHAR, sizeof(char) == 1);
TW_COMPILE_TIME_ASSERT(TW_SHORT, sizeof(short) == 2);
TW_COMPILE_TIME_ASSERT(TW_INT, sizeof(int) == 4);
TW_COMPILE_TIME_ASSERT(TW_FLOAT, sizeof(float) == 4);
TW_COMPILE_TIME_ASSERT(TW_DOUBLE, sizeof(double) == 8);
// Check pointer size on Windows
#if !defined(_WIN64) && defined(_WIN32)
// If the following assert failed, the platform is not 32-bit and _WIN64 is not defined.
// When targetting 64-bit Windows platform, _WIN64 must be defined.
TW_COMPILE_TIME_ASSERT(TW_PTR32, sizeof(void*) == 4);
#elif defined(_WIN64)
// If the following assert failed, _WIN64 is defined but the targeted platform is not 64-bit.
TW_COMPILE_TIME_ASSERT(TW_PTR64, sizeof(void*) == 8);
#endif
// ---------------------------------------------------------------------------

View File

@@ -1,6 +0,0 @@
These files are part of the AntTweakBar library.
http://www.antisphere.com/Wiki/tools:anttweakbar
Copyright <20> 2005, 2006 Philippe Decaudin.
AntTweakBar is a free software released under the zlib license.
For conditions of distribution and use, see ../License.txt

View File

@@ -1,4 +0,0 @@
linux-gate.so.1 => (0x00d1e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00dcf000)
libc.so.6 => /lib/tls/libc.so.6 (0x00113000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00773000)

View File

@@ -1,56 +1,54 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file AntPerfTimer.h
// @brief A performance (precision) timer for benchs
// @author Philippe Decaudin - http://www.antisphere.com
// @file AntPerfTimer.h
// @brief A performance (precision) timer for benchs
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: TAB=4
// No cpp file is needed, everything is defined in this header
// note: No cpp file is needed, everything is defined in this header
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_PERF_TIMER_INCLUDED
#define ANT_PERF_TIMER_INCLUDED
#ifndef __cplusplus
# error This is a C++ header
#endif // __cplusplus
# error This is a C++ header
#endif // __cplusplus
#if defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#include <tchar.h>
#include <windows.h>
#include <tchar.h>
struct PerfTimer
{
__forceinline PerfTimer() { if( !QueryPerformanceFrequency(&Freq) ) MessageBox(NULL, _T("Precision timer not supported"), _T("Problem"), MB_ICONEXCLAMATION); Reset(); }
__forceinline void Reset() { QueryPerformanceCounter(&Start); }
__forceinline double GetTime() { if( QueryPerformanceCounter(&End) ) return ((double)End.QuadPart - (double)Start.QuadPart)/((double)Freq.QuadPart); else return 0; }
protected:
LARGE_INTEGER Start, End, Freq;
};
struct PerfTimer
{
inline PerfTimer() { if( !QueryPerformanceFrequency(&Freq) ) MessageBox(NULL, _T("Precision timer not supported"), _T("Problem"), MB_ICONEXCLAMATION); Reset(); }
inline void Reset() { QueryPerformanceCounter(&Start); }
inline double GetTime() { if( QueryPerformanceCounter(&End) ) return ((double)End.QuadPart - (double)Start.QuadPart)/((double)Freq.QuadPart); else return 0; }
protected:
LARGE_INTEGER Start, End, Freq;
};
#else // !_WIN (-> LINUX)
#include <sys/time.h>
#include <unistd.h>
#include <sys/time.h>
#include <unistd.h>
struct PerfTimer
{
inline PerfTimer() { Reset(); }
inline void Reset() { gettimeofday(&Start, &TZ); }
inline double GetTime() { gettimeofday(&End,&TZ);
double t1 = (double)Start.tv_sec + (double)Start.tv_usec/(1000*1000);
double t2 = (double)End.tv_sec + (double)End.tv_usec/(1000*1000);
return t2-t1; }
protected:
struct timeval Start, End;
struct timezone TZ;
};
struct PerfTimer
{
inline PerfTimer() { Reset(); }
inline void Reset() { gettimeofday(&Start, &TZ); }
inline double GetTime() { gettimeofday(&End,&TZ);
double t1 = (double)Start.tv_sec + (double)Start.tv_usec/(1000*1000);
double t2 = (double)End.tv_sec + (double)End.tv_usec/(1000*1000);
return t2-t1; }
protected:
struct timeval Start, End;
struct timezone TZ;
};
#endif // _WIN

View File

@@ -1,29 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AntTweakBar", "AntTweakBar.vcproj", "{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwAdvanced1", "..\examples\TwAdvanced1.vcproj", "{008D1CEC-1586-4C89-B524-DF15D9605163}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug.ActiveCfg = Debug|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug.Build.0 = Debug|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release.ActiveCfg = Release|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release.Build.0 = Release|Win32
{008D1CEC-1586-4C89-B524-DF15D9605163}.Debug.ActiveCfg = Debug|Win32
{008D1CEC-1586-4C89-B524-DF15D9605163}.Debug.Build.0 = Debug|Win32
{008D1CEC-1586-4C89-B524-DF15D9605163}.Release.ActiveCfg = Release|Win32
{008D1CEC-1586-4C89-B524-DF15D9605163}.Release.Build.0 = Release|Win32
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|Win32.ActiveCfg = Debug|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|Win32.Build.0 = Debug|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|x64.ActiveCfg = Debug|x64
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Debug|x64.Build.0 = Debug|x64
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|Win32.ActiveCfg = Release|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|Win32.Build.0 = Release|Win32
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|x64.ActiveCfg = Release|x64
{B99E1FA1-C30A-45F2-9D57-9E9C21B2DF42}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@@ -1,30 +1,26 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file LoadOGL.cpp
// @author Philippe Decaudin - http://www.antisphere.com
// @file LoadOGL.cpp
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// note: TAB=4
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#include "TwPrecomp.h"
#include "LoadOGL.h"
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#define ANT_NB_OGL_FUNC_MAX 512
#define ANT_NB_OGL_FUNC_MAX 1024
struct COGLFuncRec
{
const char * m_Name;
GL::PFNOpenGL * m_FuncPtr;
COGLFuncRec() : m_Name(NULL), m_FuncPtr(NULL) {}
const char * m_Name;
GL::PFNOpenGL * m_FuncPtr;
COGLFuncRec() : m_Name(NULL), m_FuncPtr(NULL) {}
};
COGLFuncRec g_OGLFuncRec[ANT_NB_OGL_FUNC_MAX];
int g_NbOGLFunc = 0;
@@ -32,7 +28,7 @@ int g_NbOGLFunc = 0;
HMODULE g_OGLModule = NULL;
#endif
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
ANT_GL_IMPL(glAccum)
ANT_GL_IMPL(glAlphaFunc)
@@ -376,123 +372,160 @@ ANT_GL_IMPL(wglGetProcAddress)
namespace GL { PFNGLGetProcAddress _glGetProcAddress = NULL; }
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if defined(ANT_WINDOWS)
// ---------------------------------------------------------------------------
int LoadOpenGL()
{
if( g_OGLModule!=NULL )
{
return 1; // "OpenGL library already loaded"
}
g_OGLModule = LoadLibrary("OPENGL32.DLL");
if( g_OGLModule )
{
// Info(VERB_LOW, "Load %d OpenGL functions", g_NbOGLFunc);
int Res = 1;
for(int i=0; i<g_NbOGLFunc; ++i)
{
assert(g_OGLFuncRec[i].m_FuncPtr!=NULL);
assert(*(g_OGLFuncRec[i].m_FuncPtr)==NULL);
assert(g_OGLFuncRec[i].m_Name!=NULL);
assert(strlen(g_OGLFuncRec[i].m_Name)>0);
*(g_OGLFuncRec[i].m_FuncPtr) = reinterpret_cast<GL::PFNOpenGL>(GetProcAddress(g_OGLModule, g_OGLFuncRec[i].m_Name));
if( *(g_OGLFuncRec[i].m_FuncPtr)==NULL )
Res = 0; // Error("cannot find OpenGL function");
}
// ---------------------------------------------------------------------------
int LoadOpenGL()
{
if( g_OGLModule!=NULL )
{
return 1; // "OpenGL library already loaded"
}
g_OGLModule = LoadLibrary("OPENGL32.DLL");
if( g_OGLModule )
{
// Info(VERB_LOW, "Load %d OpenGL functions", g_NbOGLFunc);
int Res = 1;
for(int i=0; i<g_NbOGLFunc; ++i)
{
assert(g_OGLFuncRec[i].m_FuncPtr!=NULL);
assert(*(g_OGLFuncRec[i].m_FuncPtr)==NULL);
assert(g_OGLFuncRec[i].m_Name!=NULL);
assert(strlen(g_OGLFuncRec[i].m_Name)>0);
*(g_OGLFuncRec[i].m_FuncPtr) = reinterpret_cast<GL::PFNOpenGL>(GetProcAddress(g_OGLModule, g_OGLFuncRec[i].m_Name));
if( *(g_OGLFuncRec[i].m_FuncPtr)==NULL )
Res = 0; // Error("cannot find OpenGL function");
}
_glGetProcAddress = reinterpret_cast<GL::PFNGLGetProcAddress>(_wglGetProcAddress);
if( _glGetProcAddress==NULL )
Res = 0;
_glGetProcAddress = reinterpret_cast<GL::PFNGLGetProcAddress>(_wglGetProcAddress);
if( _glGetProcAddress==NULL )
Res = 0;
return Res;
}
else
{
// InternDisplayLastErrorWIN("Cannot load opengl32 DLL", false);
return 0; // cannot load DLL
}
}
// ---------------------------------------------------------------------------
int UnloadOpenGL()
{
if( g_OGLModule==NULL )
{
return 1; // "OpenGL library not loaded"
}
// Info(VERB_LOW, "Unload %d OpenGL functions", g_NbOGLFunc);
for(int i=0; i<g_NbOGLFunc; ++i)
{
assert(g_OGLFuncRec[i].m_FuncPtr!=NULL);
assert(*(g_OGLFuncRec[i].m_FuncPtr)!=NULL);
assert(g_OGLFuncRec[i].m_Name!=NULL);
assert(strlen(g_OGLFuncRec[i].m_Name)>0);
*(g_OGLFuncRec[i].m_FuncPtr) = NULL;
}
if( FreeLibrary(g_OGLModule) )
{
// Info(VERB_LOW, "OpenGL library unloaded");
g_OGLModule = NULL;
return 1;
}
else
{
// InternDisplayLastErrorWIN("Cannot unload opengl32 DLL", false);
return 0; // cannot unload opengl32.dll
}
}
// ---------------------------------------------------------------------------
namespace GL
{
PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr)
{
if( g_NbOGLFunc>=ANT_NB_OGL_FUNC_MAX )
{
fprintf(stderr, "Too many OpenGL functions declared. Change ANT_NB_OGL_FUNC_MAX.");
exit(-1);
}
g_OGLFuncRec[g_NbOGLFunc].m_Name = _FuncName;
g_OGLFuncRec[g_NbOGLFunc].m_FuncPtr = _FuncPtr;
++g_NbOGLFunc;
return NULL;
}
} // namespace GL
// ---------------------------------------------------------------------------
return Res;
}
else
{
// InternDisplayLastErrorWIN("Cannot load opengl32 DLL", false);
return 0; // cannot load DLL
}
}
// ---------------------------------------------------------------------------
int UnloadOpenGL()
{
if( g_OGLModule==NULL )
{
return 1; // "OpenGL library not loaded"
}
// Info(VERB_LOW, "Unload %d OpenGL functions", g_NbOGLFunc);
for(int i=0; i<g_NbOGLFunc; ++i)
{
assert(g_OGLFuncRec[i].m_FuncPtr!=NULL);
assert(*(g_OGLFuncRec[i].m_FuncPtr)!=NULL);
assert(g_OGLFuncRec[i].m_Name!=NULL);
assert(strlen(g_OGLFuncRec[i].m_Name)>0);
*(g_OGLFuncRec[i].m_FuncPtr) = NULL;
}
if( FreeLibrary(g_OGLModule) )
{
// Info(VERB_LOW, "OpenGL library unloaded");
g_OGLModule = NULL;
return 1;
}
else
{
// InternDisplayLastErrorWIN("Cannot unload opengl32 DLL", false);
return 0; // cannot unload opengl32.dll
}
}
// ---------------------------------------------------------------------------
namespace GL
{
PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr)
{
if( g_NbOGLFunc>=ANT_NB_OGL_FUNC_MAX )
{
fprintf(stderr, "Too many OpenGL functions declared. Change ANT_NB_OGL_FUNC_MAX.");
exit(-1);
}
g_OGLFuncRec[g_NbOGLFunc].m_Name = _FuncName;
g_OGLFuncRec[g_NbOGLFunc].m_FuncPtr = _FuncPtr;
++g_NbOGLFunc;
return NULL;
}
} // namespace GL
// ---------------------------------------------------------------------------
#endif // defined(ANT_WINDOWS)
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if defined(ANT_UNIX)
int LoadOpenGL()
{
_glGetProcAddress = reinterpret_cast<GL::PFNGLGetProcAddress>(glXGetProcAddressARB);
int LoadOpenGL()
{
_glGetProcAddress = reinterpret_cast<GL::PFNGLGetProcAddress>(glXGetProcAddressARB);
return 1; // "OpenGL library is statically linked"
}
int UnloadOpenGL()
{
return 1; // "OpenGL library is statically linked"
}
return 1; // "OpenGL library is statically linked"
}
int UnloadOpenGL()
{
return 1; // "OpenGL library is statically linked"
}
#elif defined(ANT_OSX)
#include <dlfcn.h>
static void *gl_dyld = NULL;
void *NSGLGetProcAddressNew(const GLubyte *name)
{
void *proc=NULL;
if (gl_dyld == NULL)
{
gl_dyld = dlopen("OpenGL",RTLD_LAZY);
}
if (gl_dyld)
{
NSString *sym = [[NSString alloc] initWithFormat: @"_%s",name];
proc = dlsym(gl_dyld,[sym UTF8String]);
[sym release];
}
return proc;
}
int LoadOpenGL()
{
_glGetProcAddress = reinterpret_cast<GL::PFNGLGetProcAddress>(NSGLGetProcAddressNew);
return 1;
}
int UnloadOpenGL()
{
if (gl_dyld)
{
dlclose(gl_dyld);
gl_dyld = NULL;
}
return 1;
}
#endif // defined(ANT_UNIX)
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------

View File

@@ -1,16 +1,14 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file LoadOGL.h
// @brief OpenGL declarations for dynamic loading
// @author Philippe Decaudin - http://www.antisphere.com
// @file LoadOGL.h
// @brief OpenGL declarations for dynamic loading
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// note: Private header
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_LOAD_OGL_INCLUDED
@@ -18,19 +16,19 @@
#define ANT_GL_DECL(_Ret, _Fct, _Params) \
extern "C" { typedef _Ret (APIENTRY* PFN##_Fct)_Params; } \
namespace GL { extern PFN##_Fct _##_Fct; } \
using GL::_##_Fct;
extern "C" { typedef _Ret (APIENTRY* PFN##_Fct)_Params; } \
namespace GL { extern PFN##_Fct _##_Fct; } \
using GL::_##_Fct;
#if defined(ANT_WINDOWS)
# define ANT_GL_IMPL(_Fct) \
namespace GL { PFN##_Fct _##_Fct = (PFN##_Fct)Record(#_Fct, (PFNOpenGL*)(&_##_Fct)); }
#elif defined(ANT_UNIX)
# define ANT_GL_IMPL(_Fct) \
namespace GL { PFN##_Fct _##_Fct = _Fct; }
# if !defined(APIENTRY)
# define APIENTRY
# endif
# define ANT_GL_IMPL(_Fct) \
namespace GL { PFN##_Fct _##_Fct = (PFN##_Fct)Record(#_Fct, (PFNOpenGL*)(&_##_Fct)); }
#elif defined(ANT_UNIX) || defined(ANT_OSX)
# define ANT_GL_IMPL(_Fct) \
namespace GL { PFN##_Fct _##_Fct = _Fct; }
# if !defined(APIENTRY)
# define APIENTRY
# endif
#endif
@@ -39,11 +37,11 @@ int UnloadOpenGL();
namespace GL
{
extern "C" { typedef void (APIENTRY* PFNOpenGL)(); }
PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr);
extern "C" { typedef void (APIENTRY* PFNOpenGL)(); }
PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr);
extern "C" { typedef PFNOpenGL (APIENTRY *PFNGLGetProcAddress)(const char *); }
extern PFNGLGetProcAddress _glGetProcAddress;
extern "C" { typedef PFNOpenGL (APIENTRY *PFNGLGetProcAddress)(const char *); }
extern PFNGLGetProcAddress _glGetProcAddress;
}
using GL::_glGetProcAddress;
@@ -348,8 +346,14 @@ ANT_GL_DECL(void, glTexGenf, (GLenum coord, GLenum pname, GLfloat param))
ANT_GL_DECL(void, glTexGenfv, (GLenum coord, GLenum pname, const GLfloat *params))
ANT_GL_DECL(void, glTexGeni, (GLenum coord, GLenum pname, GLint param))
ANT_GL_DECL(void, glTexGeniv, (GLenum coord, GLenum pname, const GLint *params))
#if defined(ANT_OSX) && (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
// Mac OSX < 10.7 redefines these OpenGL calls: glTexImage1D, glTexImage2D
ANT_GL_DECL(void, glTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
ANT_GL_DECL(void, glTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
#else
ANT_GL_DECL(void, glTexImage1D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
ANT_GL_DECL(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
#endif
ANT_GL_DECL(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param))
ANT_GL_DECL(void, glTexParameterfv, (GLenum target, GLenum pname, const GLfloat *params))
ANT_GL_DECL(void, glTexParameteri, (GLenum target, GLenum pname, GLint param))
@@ -387,7 +391,7 @@ ANT_GL_DECL(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height))
#ifdef ANT_WINDOWS
ANT_GL_DECL(PROC, wglGetProcAddress, (LPCSTR))
#endif
#endif
#endif // !defined ANT_LOAD_OGL_INCLUDED

View File

@@ -0,0 +1,527 @@
// ---------------------------------------------------------------------------
//
// @file LoadOGLCore.cpp
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// ---------------------------------------------------------------------------
#include "TwPrecomp.h"
#include "LoadOGLCore.h"
// ---------------------------------------------------------------------------
#define ANT_NB_OGL_CORE_FUNC_MAX 512
struct COGLCoreFuncRec
{
const char * m_Name;
GLCore::PFNOpenGL * m_FuncPtr;
COGLCoreFuncRec() : m_Name(NULL), m_FuncPtr(NULL) {}
};
COGLCoreFuncRec g_OGLCoreFuncRec[ANT_NB_OGL_CORE_FUNC_MAX];
int g_NbOGLCoreFunc = 0;
#if defined(ANT_WINDOWS)
HMODULE g_OGLCoreModule = NULL;
#endif
// ---------------------------------------------------------------------------
// GL 1.0
ANT_GL_CORE_IMPL(glCullFace)
ANT_GL_CORE_IMPL(glFrontFace)
ANT_GL_CORE_IMPL(glHint)
ANT_GL_CORE_IMPL(glLineWidth)
ANT_GL_CORE_IMPL(glPointSize)
ANT_GL_CORE_IMPL(glPolygonMode)
ANT_GL_CORE_IMPL(glScissor)
ANT_GL_CORE_IMPL(glTexParameterf)
ANT_GL_CORE_IMPL(glTexParameterfv)
ANT_GL_CORE_IMPL(glTexParameteri)
ANT_GL_CORE_IMPL(glTexParameteriv)
ANT_GL_CORE_IMPL(glTexImage1D)
ANT_GL_CORE_IMPL(glTexImage2D)
ANT_GL_CORE_IMPL(glDrawBuffer)
ANT_GL_CORE_IMPL(glClear)
ANT_GL_CORE_IMPL(glClearColor)
ANT_GL_CORE_IMPL(glClearStencil)
ANT_GL_CORE_IMPL(glClearDepth)
ANT_GL_CORE_IMPL(glStencilMask)
ANT_GL_CORE_IMPL(glColorMask)
ANT_GL_CORE_IMPL(glDepthMask)
ANT_GL_CORE_IMPL(glDisable)
ANT_GL_CORE_IMPL(glEnable)
ANT_GL_CORE_IMPL(glFinish)
ANT_GL_CORE_IMPL(glFlush)
ANT_GL_CORE_IMPL(glBlendFunc)
ANT_GL_CORE_IMPL(glLogicOp)
ANT_GL_CORE_IMPL(glStencilFunc)
ANT_GL_CORE_IMPL(glStencilOp)
ANT_GL_CORE_IMPL(glDepthFunc)
ANT_GL_CORE_IMPL(glPixelStoref)
ANT_GL_CORE_IMPL(glPixelStorei)
ANT_GL_CORE_IMPL(glReadBuffer)
ANT_GL_CORE_IMPL(glReadPixels)
ANT_GL_CORE_IMPL(glGetBooleanv)
ANT_GL_CORE_IMPL(glGetDoublev)
ANT_GL_CORE_IMPL(glGetError)
ANT_GL_CORE_IMPL(glGetFloatv)
ANT_GL_CORE_IMPL(glGetIntegerv)
ANT_GL_CORE_IMPL(glGetString)
ANT_GL_CORE_IMPL(glGetTexImage)
ANT_GL_CORE_IMPL(glGetTexParameterfv)
ANT_GL_CORE_IMPL(glGetTexParameteriv)
ANT_GL_CORE_IMPL(glGetTexLevelParameterfv)
ANT_GL_CORE_IMPL(glGetTexLevelParameteriv)
ANT_GL_CORE_IMPL(glIsEnabled)
ANT_GL_CORE_IMPL(glDepthRange)
ANT_GL_CORE_IMPL(glViewport)
// GL 1.1
ANT_GL_CORE_IMPL(glDrawArrays)
ANT_GL_CORE_IMPL(glDrawElements)
ANT_GL_CORE_IMPL(glGetPointerv)
ANT_GL_CORE_IMPL(glPolygonOffset)
ANT_GL_CORE_IMPL(glCopyTexImage1D)
ANT_GL_CORE_IMPL(glCopyTexImage2D)
ANT_GL_CORE_IMPL(glCopyTexSubImage1D)
ANT_GL_CORE_IMPL(glCopyTexSubImage2D)
ANT_GL_CORE_IMPL(glTexSubImage1D)
ANT_GL_CORE_IMPL(glTexSubImage2D)
ANT_GL_CORE_IMPL(glBindTexture)
ANT_GL_CORE_IMPL(glDeleteTextures)
ANT_GL_CORE_IMPL(glGenTextures)
ANT_GL_CORE_IMPL(glIsTexture)
// GL 1.2
ANT_GL_CORE_IMPL(glBlendColor)
ANT_GL_CORE_IMPL(glBlendEquation)
ANT_GL_CORE_IMPL(glDrawRangeElements)
ANT_GL_CORE_IMPL(glTexImage3D)
ANT_GL_CORE_IMPL(glTexSubImage3D)
ANT_GL_CORE_IMPL(glCopyTexSubImage3D)
// GL 1.3
ANT_GL_CORE_IMPL(glActiveTexture)
ANT_GL_CORE_IMPL(glSampleCoverage)
ANT_GL_CORE_IMPL(glCompressedTexImage3D)
ANT_GL_CORE_IMPL(glCompressedTexImage2D)
ANT_GL_CORE_IMPL(glCompressedTexImage1D)
ANT_GL_CORE_IMPL(glCompressedTexSubImage3D)
ANT_GL_CORE_IMPL(glCompressedTexSubImage2D)
ANT_GL_CORE_IMPL(glCompressedTexSubImage1D)
ANT_GL_CORE_IMPL(glGetCompressedTexImage)
// GL 1.4
ANT_GL_CORE_IMPL(glBlendFuncSeparate)
ANT_GL_CORE_IMPL(glMultiDrawArrays)
ANT_GL_CORE_IMPL(glMultiDrawElements)
ANT_GL_CORE_IMPL(glPointParameterf)
ANT_GL_CORE_IMPL(glPointParameterfv)
ANT_GL_CORE_IMPL(glPointParameteri)
ANT_GL_CORE_IMPL(glPointParameteriv)
// GL 1.5
ANT_GL_CORE_IMPL(glGenQueries)
ANT_GL_CORE_IMPL(glDeleteQueries)
ANT_GL_CORE_IMPL(glIsQuery)
ANT_GL_CORE_IMPL(glBeginQuery)
ANT_GL_CORE_IMPL(glEndQuery)
ANT_GL_CORE_IMPL(glGetQueryiv)
ANT_GL_CORE_IMPL(glGetQueryObjectiv)
ANT_GL_CORE_IMPL(glGetQueryObjectuiv)
ANT_GL_CORE_IMPL(glBindBuffer)
ANT_GL_CORE_IMPL(glDeleteBuffers)
ANT_GL_CORE_IMPL(glGenBuffers)
ANT_GL_CORE_IMPL(glIsBuffer)
ANT_GL_CORE_IMPL(glBufferData)
ANT_GL_CORE_IMPL(glBufferSubData)
ANT_GL_CORE_IMPL(glGetBufferSubData)
ANT_GL_CORE_IMPL(glMapBuffer)
ANT_GL_CORE_IMPL(glUnmapBuffer)
ANT_GL_CORE_IMPL(glGetBufferParameteriv)
ANT_GL_CORE_IMPL(glGetBufferPointerv)
// GL 2.0
ANT_GL_CORE_IMPL(glBlendEquationSeparate)
ANT_GL_CORE_IMPL(glDrawBuffers)
ANT_GL_CORE_IMPL(glStencilOpSeparate)
ANT_GL_CORE_IMPL(glStencilFuncSeparate)
ANT_GL_CORE_IMPL(glStencilMaskSeparate)
ANT_GL_CORE_IMPL(glAttachShader)
ANT_GL_CORE_IMPL(glBindAttribLocation)
ANT_GL_CORE_IMPL(glCompileShader)
ANT_GL_CORE_IMPL(glCreateProgram)
ANT_GL_CORE_IMPL(glCreateShader)
ANT_GL_CORE_IMPL(glDeleteProgram)
ANT_GL_CORE_IMPL(glDeleteShader)
ANT_GL_CORE_IMPL(glDetachShader)
ANT_GL_CORE_IMPL(glDisableVertexAttribArray)
ANT_GL_CORE_IMPL(glEnableVertexAttribArray)
ANT_GL_CORE_IMPL(glGetActiveAttrib)
ANT_GL_CORE_IMPL(glGetActiveUniform)
ANT_GL_CORE_IMPL(glGetAttachedShaders)
ANT_GL_CORE_IMPL(glGetAttribLocation)
ANT_GL_CORE_IMPL(glGetProgramiv)
ANT_GL_CORE_IMPL(glGetProgramInfoLog)
ANT_GL_CORE_IMPL(glGetShaderiv)
ANT_GL_CORE_IMPL(glGetShaderInfoLog)
ANT_GL_CORE_IMPL(glGetShaderSource)
ANT_GL_CORE_IMPL(glGetUniformLocation)
ANT_GL_CORE_IMPL(glGetUniformfv)
ANT_GL_CORE_IMPL(glGetUniformiv)
ANT_GL_CORE_IMPL(glGetVertexAttribdv)
ANT_GL_CORE_IMPL(glGetVertexAttribfv)
ANT_GL_CORE_IMPL(glGetVertexAttribiv)
ANT_GL_CORE_IMPL(glGetVertexAttribPointerv)
ANT_GL_CORE_IMPL(glIsProgram)
ANT_GL_CORE_IMPL(glIsShader)
ANT_GL_CORE_IMPL(glLinkProgram)
ANT_GL_CORE_IMPL(glShaderSource)
ANT_GL_CORE_IMPL(glUseProgram)
ANT_GL_CORE_IMPL(glUniform1f)
ANT_GL_CORE_IMPL(glUniform2f)
ANT_GL_CORE_IMPL(glUniform3f)
ANT_GL_CORE_IMPL(glUniform4f)
ANT_GL_CORE_IMPL(glUniform1i)
ANT_GL_CORE_IMPL(glUniform2i)
ANT_GL_CORE_IMPL(glUniform3i)
ANT_GL_CORE_IMPL(glUniform4i)
ANT_GL_CORE_IMPL(glUniform1fv)
ANT_GL_CORE_IMPL(glUniform2fv)
ANT_GL_CORE_IMPL(glUniform3fv)
ANT_GL_CORE_IMPL(glUniform4fv)
ANT_GL_CORE_IMPL(glUniform1iv)
ANT_GL_CORE_IMPL(glUniform2iv)
ANT_GL_CORE_IMPL(glUniform3iv)
ANT_GL_CORE_IMPL(glUniform4iv)
ANT_GL_CORE_IMPL(glUniformMatrix2fv)
ANT_GL_CORE_IMPL(glUniformMatrix3fv)
ANT_GL_CORE_IMPL(glUniformMatrix4fv)
ANT_GL_CORE_IMPL(glValidateProgram)
ANT_GL_CORE_IMPL(glVertexAttrib1d)
ANT_GL_CORE_IMPL(glVertexAttrib1dv)
ANT_GL_CORE_IMPL(glVertexAttrib1f)
ANT_GL_CORE_IMPL(glVertexAttrib1fv)
ANT_GL_CORE_IMPL(glVertexAttrib1s)
ANT_GL_CORE_IMPL(glVertexAttrib1sv)
ANT_GL_CORE_IMPL(glVertexAttrib2d)
ANT_GL_CORE_IMPL(glVertexAttrib2dv)
ANT_GL_CORE_IMPL(glVertexAttrib2f)
ANT_GL_CORE_IMPL(glVertexAttrib2fv)
ANT_GL_CORE_IMPL(glVertexAttrib2s)
ANT_GL_CORE_IMPL(glVertexAttrib2sv)
ANT_GL_CORE_IMPL(glVertexAttrib3d)
ANT_GL_CORE_IMPL(glVertexAttrib3dv)
ANT_GL_CORE_IMPL(glVertexAttrib3f)
ANT_GL_CORE_IMPL(glVertexAttrib3fv)
ANT_GL_CORE_IMPL(glVertexAttrib3s)
ANT_GL_CORE_IMPL(glVertexAttrib3sv)
ANT_GL_CORE_IMPL(glVertexAttrib4Nbv)
ANT_GL_CORE_IMPL(glVertexAttrib4Niv)
ANT_GL_CORE_IMPL(glVertexAttrib4Nsv)
ANT_GL_CORE_IMPL(glVertexAttrib4Nub)
ANT_GL_CORE_IMPL(glVertexAttrib4Nubv)
ANT_GL_CORE_IMPL(glVertexAttrib4Nuiv)
ANT_GL_CORE_IMPL(glVertexAttrib4Nusv)
ANT_GL_CORE_IMPL(glVertexAttrib4bv)
ANT_GL_CORE_IMPL(glVertexAttrib4d)
ANT_GL_CORE_IMPL(glVertexAttrib4dv)
ANT_GL_CORE_IMPL(glVertexAttrib4f)
ANT_GL_CORE_IMPL(glVertexAttrib4fv)
ANT_GL_CORE_IMPL(glVertexAttrib4iv)
ANT_GL_CORE_IMPL(glVertexAttrib4s)
ANT_GL_CORE_IMPL(glVertexAttrib4sv)
ANT_GL_CORE_IMPL(glVertexAttrib4ubv)
ANT_GL_CORE_IMPL(glVertexAttrib4uiv)
ANT_GL_CORE_IMPL(glVertexAttrib4usv)
ANT_GL_CORE_IMPL(glVertexAttribPointer)
/*
// GL 2.1
ANT_GL_CORE_IMPL(glUniformMatrix2x3fv)
ANT_GL_CORE_IMPL(glUniformMatrix3x2fv)
ANT_GL_CORE_IMPL(glUniformMatrix2x4fv)
ANT_GL_CORE_IMPL(glUniformMatrix4x2fv)
ANT_GL_CORE_IMPL(glUniformMatrix3x4fv)
ANT_GL_CORE_IMPL(glUniformMatrix4x3fv)
// GL 3.0
ANT_GL_CORE_IMPL(glColorMaski)
ANT_GL_CORE_IMPL(glGetBooleani_v)
ANT_GL_CORE_IMPL(glGetIntegeri_v)
ANT_GL_CORE_IMPL(glEnablei)
ANT_GL_CORE_IMPL(glDisablei)
ANT_GL_CORE_IMPL(glIsEnabledi)
ANT_GL_CORE_IMPL(glBeginTransformFeedback)
ANT_GL_CORE_IMPL(glEndTransformFeedback)
ANT_GL_CORE_IMPL(glBindBufferRange)
ANT_GL_CORE_IMPL(glBindBufferBase)
ANT_GL_CORE_IMPL(glTransformFeedbackVaryings)
ANT_GL_CORE_IMPL(glGetTransformFeedbackVarying)
ANT_GL_CORE_IMPL(glClampColor)
ANT_GL_CORE_IMPL(glBeginConditionalRender)
ANT_GL_CORE_IMPL(glEndConditionalRender)
ANT_GL_CORE_IMPL(glVertexAttribIPointer)
ANT_GL_CORE_IMPL(glGetVertexAttribIiv)
ANT_GL_CORE_IMPL(glGetVertexAttribIuiv)
ANT_GL_CORE_IMPL(glVertexAttribI1i)
ANT_GL_CORE_IMPL(glVertexAttribI2i)
ANT_GL_CORE_IMPL(glVertexAttribI3i)
ANT_GL_CORE_IMPL(glVertexAttribI4i)
ANT_GL_CORE_IMPL(glVertexAttribI1ui)
ANT_GL_CORE_IMPL(glVertexAttribI2ui)
ANT_GL_CORE_IMPL(glVertexAttribI3ui)
ANT_GL_CORE_IMPL(glVertexAttribI4ui)
ANT_GL_CORE_IMPL(glVertexAttribI1iv)
ANT_GL_CORE_IMPL(glVertexAttribI2iv)
ANT_GL_CORE_IMPL(glVertexAttribI3iv)
ANT_GL_CORE_IMPL(glVertexAttribI4iv)
ANT_GL_CORE_IMPL(glVertexAttribI1uiv)
ANT_GL_CORE_IMPL(glVertexAttribI2uiv)
ANT_GL_CORE_IMPL(glVertexAttribI3uiv)
ANT_GL_CORE_IMPL(glVertexAttribI4uiv)
ANT_GL_CORE_IMPL(glVertexAttribI4bv)
ANT_GL_CORE_IMPL(glVertexAttribI4sv)
ANT_GL_CORE_IMPL(glVertexAttribI4ubv)
ANT_GL_CORE_IMPL(glVertexAttribI4usv)
ANT_GL_CORE_IMPL(glGetUniformuiv)
ANT_GL_CORE_IMPL(glBindFragDataLocation)
ANT_GL_CORE_IMPL(glGetFragDataLocation)
ANT_GL_CORE_IMPL(glUniform1ui)
ANT_GL_CORE_IMPL(glUniform2ui)
ANT_GL_CORE_IMPL(glUniform3ui)
ANT_GL_CORE_IMPL(glUniform4ui)
ANT_GL_CORE_IMPL(glUniform1uiv)
ANT_GL_CORE_IMPL(glUniform2uiv)
ANT_GL_CORE_IMPL(glUniform3uiv)
ANT_GL_CORE_IMPL(glUniform4uiv)
ANT_GL_CORE_IMPL(glTexParameterIiv)
ANT_GL_CORE_IMPL(glTexParameterIuiv)
ANT_GL_CORE_IMPL(glGetTexParameterIiv)
ANT_GL_CORE_IMPL(glGetTexParameterIuiv)
ANT_GL_CORE_IMPL(glClearBufferiv)
ANT_GL_CORE_IMPL(glClearBufferuiv)
ANT_GL_CORE_IMPL(glClearBufferfv)
ANT_GL_CORE_IMPL(glClearBufferfi)
ANT_GL_CORE_IMPL(glGetStringi)
// GL 3.1
ANT_GL_CORE_IMPL(glDrawArraysInstanced)
ANT_GL_CORE_IMPL(glDrawElementsInstanced)
ANT_GL_CORE_IMPL(glTexBuffer)
ANT_GL_CORE_IMPL(glPrimitiveRestartIndex)
// GL 3.2
//ANT_GL_CORE_IMPL(glGetInteger64i_v)
//ANT_GL_CORE_IMPL(glGetBufferParameteri64v)
ANT_GL_CORE_IMPL(glFramebufferTexture)
*/
// GL_ARB_vertex_array_object
#if defined(ANT_WINDOWS)
ANT_GL_CORE_IMPL(glBindVertexArray)
ANT_GL_CORE_IMPL(glDeleteVertexArrays)
ANT_GL_CORE_IMPL(glGenVertexArrays)
ANT_GL_CORE_IMPL(glIsVertexArray)
#else
// these extensions are loaded explicitely by LoadOpenGLCore
// because they may not be avialable on non-OpenGL 3.2 environments
namespace GLCore
{
PFNglBindVertexArray _glBindVertexArray = NULL;
PFNglDeleteVertexArrays _glDeleteVertexArrays = NULL;
PFNglGenVertexArrays _glGenVertexArrays = NULL;
PFNglIsVertexArray _glIsVertexArray = NULL;
}
#endif
#if defined(ANT_WINDOWS)
ANT_GL_CORE_IMPL(wglGetProcAddress)
#endif
namespace GLCore { PFNGLGetProcAddress _glGetProcAddress = NULL; }
// ---------------------------------------------------------------------------
#if defined(ANT_WINDOWS)
// ---------------------------------------------------------------------------
int LoadOpenGLCore()
{
if( g_OGLCoreModule!=NULL )
{
return 1; // "OpenGL library already loaded"
}
g_OGLCoreModule = LoadLibrary("OPENGL32.DLL");
if( g_OGLCoreModule )
{
// Info(VERB_LOW, "Load %d OpenGL Core functions", g_NbOGLCoreFunc);
int Res = 1;
// Use wglGetProcAddress to retreive Core functions
_glGetProcAddress = reinterpret_cast<GLCore::PFNGLGetProcAddress>(GetProcAddress(g_OGLCoreModule, "wglGetProcAddress"));
if( _glGetProcAddress!=NULL )
for(int i=0; i<g_NbOGLCoreFunc; ++i)
{
assert(g_OGLCoreFuncRec[i].m_FuncPtr!=NULL);
assert(*(g_OGLCoreFuncRec[i].m_FuncPtr)==NULL);
assert(g_OGLCoreFuncRec[i].m_Name!=NULL);
assert(strlen(g_OGLCoreFuncRec[i].m_Name)>0);
// Try to get the function pointer with wglGetProcAddress
*(g_OGLCoreFuncRec[i].m_FuncPtr) = reinterpret_cast<GLCore::PFNOpenGL>(_glGetProcAddress(g_OGLCoreFuncRec[i].m_Name));
if( *(g_OGLCoreFuncRec[i].m_FuncPtr)==NULL )
{
// Try to get the function pointer with GetProcAddress
*(g_OGLCoreFuncRec[i].m_FuncPtr) = reinterpret_cast<GLCore::PFNOpenGL>(GetProcAddress(g_OGLCoreModule, g_OGLCoreFuncRec[i].m_Name));
if( *(g_OGLCoreFuncRec[i].m_FuncPtr)==NULL )
{
#ifdef _DEBUG
fprintf(stderr, "AntTweakBar: Cannot load function %s\n", g_OGLCoreFuncRec[i].m_Name);
#endif
Res = 0; // Error("cannot find OpenGL Core function");
}
}
}
return Res;
}
else
{
// InternDisplayLastErrorWIN("Cannot load opengl32 DLL", false);
return 0; // cannot load DLL
}
}
// ---------------------------------------------------------------------------
int UnloadOpenGLCore()
{
if( g_OGLCoreModule==NULL )
{
return 1; // "OpenGL library not loaded"
}
// Info(VERB_LOW, "Unload %d OpenGL Core functions", g_NbOGLCoreFunc);
for(int i=0; i<g_NbOGLCoreFunc; ++i)
{
assert(g_OGLCoreFuncRec[i].m_FuncPtr!=NULL);
assert(*(g_OGLCoreFuncRec[i].m_FuncPtr)!=NULL);
assert(g_OGLCoreFuncRec[i].m_Name!=NULL);
assert(strlen(g_OGLCoreFuncRec[i].m_Name)>0);
*(g_OGLCoreFuncRec[i].m_FuncPtr) = NULL;
}
if( FreeLibrary(g_OGLCoreModule) )
{
// Info(VERB_LOW, "OpenGL library unloaded");
g_OGLCoreModule = NULL;
return 1;
}
else
{
// InternDisplayLastErrorWIN("Cannot unload opengl32 DLL", false);
return 0; // cannot unload opengl32.dll
}
}
// ---------------------------------------------------------------------------
namespace GLCore
{
PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr)
{
if( g_NbOGLCoreFunc>=ANT_NB_OGL_CORE_FUNC_MAX )
{
fprintf(stderr, "Too many OpenGL Core functions declared. Change ANT_NB_OGL_CORE_FUNC_MAX.");
exit(-1);
}
g_OGLCoreFuncRec[g_NbOGLCoreFunc].m_Name = _FuncName;
g_OGLCoreFuncRec[g_NbOGLCoreFunc].m_FuncPtr = _FuncPtr;
++g_NbOGLCoreFunc;
return NULL;
}
} // namespace GL
// ---------------------------------------------------------------------------
#endif // defined(ANT_WINDOWS)
// ---------------------------------------------------------------------------
#if defined(ANT_UNIX)
int LoadOpenGLCore()
{
_glGetProcAddress = reinterpret_cast<GLCore::PFNGLGetProcAddress>(glXGetProcAddressARB);
_glBindVertexArray = reinterpret_cast<PFNglBindVertexArray>(_glGetProcAddress("glBindVertexArray"));
_glDeleteVertexArrays = reinterpret_cast<PFNglDeleteVertexArrays>(_glGetProcAddress("glDeleteVertexArrays"));
_glGenVertexArrays = reinterpret_cast<PFNglGenVertexArrays>(_glGetProcAddress("glGenVertexArrays"));
_glIsVertexArray = reinterpret_cast<PFNglIsVertexArray>(_glGetProcAddress("glIsVertexArray"));
if( _glBindVertexArray==NULL || _glDeleteVertexArrays==NULL || _glGenVertexArrays==NULL || _glIsVertexArray==NULL )
{
fprintf(stderr, "AntTweakBar: OpenGL Core Profile functions cannot be loaded.\n");
return 0;
}
else
return 1;
}
int UnloadOpenGLCore()
{
return 1;
}
#elif defined(ANT_OSX)
#include <dlfcn.h>
static void *gl_dyld = NULL;
void *NSGLCoreGetProcAddressNew(const GLubyte *name)
{
void *proc=NULL;
if (gl_dyld == NULL)
{
gl_dyld = dlopen("OpenGL",RTLD_LAZY);
}
if (gl_dyld)
{
NSString *sym = [[NSString alloc] initWithFormat: @"_%s",name];
proc = dlsym(gl_dyld,[sym UTF8String]);
[sym release];
}
return proc;
}
int LoadOpenGLCore()
{
_glGetProcAddress = reinterpret_cast<GLCore::PFNGLGetProcAddress>(NSGLCoreGetProcAddressNew);
_glBindVertexArray = reinterpret_cast<PFNglBindVertexArray>(_glGetProcAddress("glBindVertexArray"));
_glDeleteVertexArrays = reinterpret_cast<PFNglDeleteVertexArrays>(_glGetProcAddress("glDeleteVertexArrays"));
_glGenVertexArrays = reinterpret_cast<PFNglGenVertexArrays>(_glGetProcAddress("glGenVertexArrays"));
_glIsVertexArray = reinterpret_cast<PFNglIsVertexArray>(_glGetProcAddress("glIsVertexArray"));
if( _glBindVertexArray==NULL || _glDeleteVertexArrays==NULL || _glGenVertexArrays==NULL || _glIsVertexArray==NULL )
{
fprintf(stderr, "AntTweakBar: OpenGL Core Profile functions cannot be loaded.\n");
return 0;
}
else
return 1;
}
int UnloadOpenGLCore()
{
if (gl_dyld)
{
dlclose(gl_dyld);
gl_dyld = NULL;
}
return 1;
}
#endif // defined(ANT_UNIX)
// ---------------------------------------------------------------------------

View File

@@ -0,0 +1,403 @@
// ---------------------------------------------------------------------------
//
// @file LoadOGLCore.h
// @brief OpenGL Core Profile declarations for dynamic loading
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// note: Private header
//
// ---------------------------------------------------------------------------
#if !defined ANT_LOAD_OGL_CORE_INCLUDED
#define ANT_LOAD_OGL_CORE_INCLUDED
#define ANT_GL_CORE_DECL_NO_FORWARD(_Ret, _Fct, _Params) \
extern "C" { typedef _Ret (APIENTRY* PFN##_Fct)_Params; } \
namespace GLCore { extern PFN##_Fct _##_Fct; } \
using GLCore::_##_Fct;
#if defined(ANT_WINDOWS)
# define ANT_GL_CORE_DECL(_Ret, _Fct, _Params) \
ANT_GL_CORE_DECL_NO_FORWARD(_Ret, _Fct, _Params)
# define ANT_GL_CORE_IMPL(_Fct) \
namespace GLCore { PFN##_Fct _##_Fct = (PFN##_Fct)Record(#_Fct, (PFNOpenGL*)(&_##_Fct)); }
#elif defined(ANT_UNIX) || defined(ANT_OSX)
# if !defined(APIENTRY)
# define APIENTRY
# endif
# define ANT_GL_CORE_DECL(_Ret, _Fct, _Params) \
ANT_GL_CORE_DECL_NO_FORWARD(_Ret, _Fct, _Params) \
extern "C" { _Ret APIENTRY _Fct _Params; }
# define ANT_GL_CORE_IMPL(_Fct) \
namespace GLCore { PFN##_Fct _##_Fct = _Fct; }
#endif
int LoadOpenGLCore();
int UnloadOpenGLCore();
namespace GLCore
{
extern "C" { typedef void (APIENTRY* PFNOpenGL)(); }
PFNOpenGL Record(const char *_FuncName, PFNOpenGL *_FuncPtr);
extern "C" { typedef PFNOpenGL (APIENTRY *PFNGLGetProcAddress)(const char *); }
extern PFNGLGetProcAddress _glGetProcAddress;
}
using GLCore::_glGetProcAddress;
// GL 1.0
ANT_GL_CORE_DECL(void, glCullFace, (GLenum mode))
ANT_GL_CORE_DECL(void, glFrontFace, (GLenum mode))
ANT_GL_CORE_DECL(void, glHint, (GLenum target, GLenum mode))
ANT_GL_CORE_DECL(void, glLineWidth, (GLfloat width))
ANT_GL_CORE_DECL(void, glPointSize, (GLfloat size))
ANT_GL_CORE_DECL(void, glPolygonMode, (GLenum face, GLenum mode))
ANT_GL_CORE_DECL(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height))
ANT_GL_CORE_DECL(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param))
ANT_GL_CORE_DECL(void, glTexParameterfv, (GLenum target, GLenum pname, const GLfloat *params))
ANT_GL_CORE_DECL(void, glTexParameteri, (GLenum target, GLenum pname, GLint param))
ANT_GL_CORE_DECL(void, glTexParameteriv, (GLenum target, GLenum pname, const GLint *params))
#if defined(ANT_OSX) && (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
// Mac OSX < 10.7 redefines these OpenGL calls: glTexImage1D, glTexImage2D
ANT_GL_CORE_DECL(void, glTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
ANT_GL_CORE_DECL(void, glTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
#else
ANT_GL_CORE_DECL(void, glTexImage1D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
ANT_GL_CORE_DECL(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
#endif
ANT_GL_CORE_DECL(void, glDrawBuffer, (GLenum mode))
ANT_GL_CORE_DECL(void, glClear, (GLbitfield mask))
ANT_GL_CORE_DECL(void, glClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha))
ANT_GL_CORE_DECL(void, glClearStencil, (GLint s))
ANT_GL_CORE_DECL(void, glClearDepth, (GLclampd depth))
ANT_GL_CORE_DECL(void, glStencilMask, (GLuint mask))
ANT_GL_CORE_DECL(void, glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha))
ANT_GL_CORE_DECL(void, glDepthMask, (GLboolean flag))
ANT_GL_CORE_DECL(void, glDisable, (GLenum cap))
ANT_GL_CORE_DECL(void, glEnable, (GLenum cap))
ANT_GL_CORE_DECL(void, glFinish, (void))
ANT_GL_CORE_DECL(void, glFlush, (void))
ANT_GL_CORE_DECL(void, glBlendFunc, (GLenum sfactor, GLenum dfactor))
ANT_GL_CORE_DECL(void, glLogicOp, (GLenum opcode))
ANT_GL_CORE_DECL(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask))
ANT_GL_CORE_DECL(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass))
ANT_GL_CORE_DECL(void, glDepthFunc, (GLenum func))
ANT_GL_CORE_DECL(void, glPixelStoref, (GLenum pname, GLfloat param))
ANT_GL_CORE_DECL(void, glPixelStorei, (GLenum pname, GLint param))
ANT_GL_CORE_DECL(void, glReadBuffer, (GLenum mode))
ANT_GL_CORE_DECL(void, glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels))
ANT_GL_CORE_DECL(void, glGetBooleanv, (GLenum pname, GLboolean *params))
ANT_GL_CORE_DECL(void, glGetDoublev, (GLenum pname, GLdouble *params))
ANT_GL_CORE_DECL(GLenum, glGetError, (void))
ANT_GL_CORE_DECL(void, glGetFloatv, (GLenum pname, GLfloat *params))
ANT_GL_CORE_DECL(void, glGetIntegerv, (GLenum pname, GLint *params))
ANT_GL_CORE_DECL(const GLubyte *, glGetString, (GLenum name))
ANT_GL_CORE_DECL(void, glGetTexImage, (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels))
ANT_GL_CORE_DECL(void, glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat *params))
ANT_GL_CORE_DECL(void, glGetTexParameteriv, (GLenum target, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetTexLevelParameterfv, (GLenum target, GLint level, GLenum pname, GLfloat *params))
ANT_GL_CORE_DECL(void, glGetTexLevelParameteriv, (GLenum target, GLint level, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(GLboolean, glIsEnabled, (GLenum cap))
ANT_GL_CORE_DECL(void, glDepthRange, (GLclampd near, GLclampd far))
ANT_GL_CORE_DECL(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height))
// GL 1.1
ANT_GL_CORE_DECL(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count))
ANT_GL_CORE_DECL(void, glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices))
ANT_GL_CORE_DECL(void, glGetPointerv, (GLenum pname, GLvoid* *params))
ANT_GL_CORE_DECL(void, glPolygonOffset, (GLfloat factor, GLfloat units))
ANT_GL_CORE_DECL(void, glCopyTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border))
ANT_GL_CORE_DECL(void, glCopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border))
ANT_GL_CORE_DECL(void, glCopyTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width))
ANT_GL_CORE_DECL(void, glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height))
ANT_GL_CORE_DECL(void, glTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels))
ANT_GL_CORE_DECL(void, glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels))
ANT_GL_CORE_DECL(void, glBindTexture, (GLenum target, GLuint texture))
ANT_GL_CORE_DECL(void, glDeleteTextures, (GLsizei n, const GLuint *textures))
ANT_GL_CORE_DECL(void, glGenTextures, (GLsizei n, GLuint *textures))
ANT_GL_CORE_DECL(GLboolean, glIsTexture, (GLuint texture))
// GL 1.2
ANT_GL_CORE_DECL(void, glBlendColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha))
ANT_GL_CORE_DECL(void, glBlendEquation, (GLenum mode))
ANT_GL_CORE_DECL(void, glDrawRangeElements, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices))
#if defined(ANT_OSX) && (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
// Mac OSX < 10.7 redefines this OpenGL call: glTexImage3D
ANT_GL_CORE_DECL(void, glTexImage3D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
#else
ANT_GL_CORE_DECL(void, glTexImage3D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
#endif
ANT_GL_CORE_DECL(void, glTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels))
ANT_GL_CORE_DECL(void, glCopyTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height))
// GL 1.3
ANT_GL_CORE_DECL(void, glActiveTexture, (GLenum texture))
ANT_GL_CORE_DECL(void, glSampleCoverage, (GLclampf value, GLboolean invert))
ANT_GL_CORE_DECL(void, glCompressedTexImage3D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data))
ANT_GL_CORE_DECL(void, glCompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data))
ANT_GL_CORE_DECL(void, glCompressedTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data))
ANT_GL_CORE_DECL(void, glCompressedTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data))
ANT_GL_CORE_DECL(void, glCompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data))
ANT_GL_CORE_DECL(void, glCompressedTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data))
ANT_GL_CORE_DECL(void, glGetCompressedTexImage, (GLenum target, GLint level, GLvoid *img))
// GL 1.4
ANT_GL_CORE_DECL(void, glBlendFuncSeparate, (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha))
ANT_GL_CORE_DECL(void, glMultiDrawArrays, (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount))
ANT_GL_CORE_DECL(void, glMultiDrawElements, (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount))
ANT_GL_CORE_DECL(void, glPointParameterf, (GLenum pname, GLfloat param))
ANT_GL_CORE_DECL(void, glPointParameterfv, (GLenum pname, const GLfloat *params))
ANT_GL_CORE_DECL(void, glPointParameteri, (GLenum pname, GLint param))
ANT_GL_CORE_DECL(void, glPointParameteriv, (GLenum pname, const GLint *params))
// GL 1.5
#ifndef ANT_OSX
typedef ptrdiff_t GLintptr;
typedef ptrdiff_t GLsizeiptr;
#endif
ANT_GL_CORE_DECL(void, glGenQueries, (GLsizei n, GLuint *ids))
ANT_GL_CORE_DECL(void, glDeleteQueries, (GLsizei n, const GLuint *ids))
ANT_GL_CORE_DECL(GLboolean, glIsQuery, (GLuint id))
ANT_GL_CORE_DECL(void, glBeginQuery, (GLenum target, GLuint id))
ANT_GL_CORE_DECL(void, glEndQuery, (GLenum target))
ANT_GL_CORE_DECL(void, glGetQueryiv, (GLenum target, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetQueryObjectiv, (GLuint id, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetQueryObjectuiv, (GLuint id, GLenum pname, GLuint *params))
ANT_GL_CORE_DECL(void, glBindBuffer, (GLenum target, GLuint buffer))
ANT_GL_CORE_DECL(void, glDeleteBuffers, (GLsizei n, const GLuint *buffers))
ANT_GL_CORE_DECL(void, glGenBuffers, (GLsizei n, GLuint *buffers))
ANT_GL_CORE_DECL(GLboolean, glIsBuffer, (GLuint buffer))
ANT_GL_CORE_DECL(void, glBufferData, (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage))
ANT_GL_CORE_DECL(void, glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data))
ANT_GL_CORE_DECL(void, glGetBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data))
ANT_GL_CORE_DECL(GLvoid*, glMapBuffer, (GLenum target, GLenum access))
ANT_GL_CORE_DECL(GLboolean, glUnmapBuffer, (GLenum target))
ANT_GL_CORE_DECL(void, glGetBufferParameteriv, (GLenum target, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetBufferPointerv, (GLenum target, GLenum pname, GLvoid* *params))
// GL 2.0
typedef char GLchar;
ANT_GL_CORE_DECL(void, glBlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha))
ANT_GL_CORE_DECL(void, glDrawBuffers, (GLsizei n, const GLenum *bufs))
ANT_GL_CORE_DECL(void, glStencilOpSeparate, (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass))
ANT_GL_CORE_DECL(void, glStencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask))
ANT_GL_CORE_DECL(void, glStencilMaskSeparate, (GLenum face, GLuint mask))
ANT_GL_CORE_DECL(void, glAttachShader, (GLuint program, GLuint shader))
ANT_GL_CORE_DECL(void, glBindAttribLocation, (GLuint program, GLuint index, const GLchar *name))
ANT_GL_CORE_DECL(void, glCompileShader, (GLuint shader))
ANT_GL_CORE_DECL(GLuint, glCreateProgram, (void))
ANT_GL_CORE_DECL(GLuint, glCreateShader, (GLenum type))
ANT_GL_CORE_DECL(void, glDeleteProgram, (GLuint program))
ANT_GL_CORE_DECL(void, glDeleteShader, (GLuint shader))
ANT_GL_CORE_DECL(void, glDetachShader, (GLuint program, GLuint shader))
ANT_GL_CORE_DECL(void, glDisableVertexAttribArray, (GLuint index))
ANT_GL_CORE_DECL(void, glEnableVertexAttribArray, (GLuint index))
ANT_GL_CORE_DECL(void, glGetActiveAttrib, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name))
ANT_GL_CORE_DECL(void, glGetActiveUniform, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name))
ANT_GL_CORE_DECL(void, glGetAttachedShaders, (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj))
ANT_GL_CORE_DECL(GLint, glGetAttribLocation, (GLuint program, const GLchar *name))
ANT_GL_CORE_DECL(void, glGetProgramiv, (GLuint program, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetProgramInfoLog, (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog))
ANT_GL_CORE_DECL(void, glGetShaderiv, (GLuint shader, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetShaderInfoLog, (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog))
ANT_GL_CORE_DECL(void, glGetShaderSource, (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source))
ANT_GL_CORE_DECL(GLint, glGetUniformLocation, (GLuint program, const GLchar *name))
ANT_GL_CORE_DECL(void, glGetUniformfv, (GLuint program, GLint location, GLfloat *params))
ANT_GL_CORE_DECL(void, glGetUniformiv, (GLuint program, GLint location, GLint *params))
ANT_GL_CORE_DECL(void, glGetVertexAttribdv, (GLuint index, GLenum pname, GLdouble *params))
ANT_GL_CORE_DECL(void, glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat *params))
ANT_GL_CORE_DECL(void, glGetVertexAttribiv, (GLuint index, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetVertexAttribPointerv, (GLuint index, GLenum pname, GLvoid* *pointer))
ANT_GL_CORE_DECL(GLboolean, glIsProgram, (GLuint program))
ANT_GL_CORE_DECL(GLboolean, glIsShader, (GLuint shader))
ANT_GL_CORE_DECL(void, glLinkProgram, (GLuint program))
ANT_GL_CORE_DECL(void, glShaderSource, (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length))
ANT_GL_CORE_DECL(void, glUseProgram, (GLuint program))
ANT_GL_CORE_DECL(void, glUniform1f, (GLint location, GLfloat v0))
ANT_GL_CORE_DECL(void, glUniform2f, (GLint location, GLfloat v0, GLfloat v1))
ANT_GL_CORE_DECL(void, glUniform3f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2))
ANT_GL_CORE_DECL(void, glUniform4f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3))
ANT_GL_CORE_DECL(void, glUniform1i, (GLint location, GLint v0))
ANT_GL_CORE_DECL(void, glUniform2i, (GLint location, GLint v0, GLint v1))
ANT_GL_CORE_DECL(void, glUniform3i, (GLint location, GLint v0, GLint v1, GLint v2))
ANT_GL_CORE_DECL(void, glUniform4i, (GLint location, GLint v0, GLint v1, GLint v2, GLint v3))
ANT_GL_CORE_DECL(void, glUniform1fv, (GLint location, GLsizei count, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniform2fv, (GLint location, GLsizei count, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniform3fv, (GLint location, GLsizei count, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniform4fv, (GLint location, GLsizei count, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniform1iv, (GLint location, GLsizei count, const GLint *value))
ANT_GL_CORE_DECL(void, glUniform2iv, (GLint location, GLsizei count, const GLint *value))
ANT_GL_CORE_DECL(void, glUniform3iv, (GLint location, GLsizei count, const GLint *value))
ANT_GL_CORE_DECL(void, glUniform4iv, (GLint location, GLsizei count, const GLint *value))
ANT_GL_CORE_DECL(void, glUniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
ANT_GL_CORE_DECL(void, glValidateProgram, (GLuint program))
ANT_GL_CORE_DECL(void, glVertexAttrib1d, (GLuint index, GLdouble x))
ANT_GL_CORE_DECL(void, glVertexAttrib1dv, (GLuint index, const GLdouble *v))
ANT_GL_CORE_DECL(void, glVertexAttrib1f, (GLuint index, GLfloat x))
ANT_GL_CORE_DECL(void, glVertexAttrib1fv, (GLuint index, const GLfloat *v))
ANT_GL_CORE_DECL(void, glVertexAttrib1s, (GLuint index, GLshort x))
ANT_GL_CORE_DECL(void, glVertexAttrib1sv, (GLuint index, const GLshort *v))
ANT_GL_CORE_DECL(void, glVertexAttrib2d, (GLuint index, GLdouble x, GLdouble y))
ANT_GL_CORE_DECL(void, glVertexAttrib2dv, (GLuint index, const GLdouble *v))
ANT_GL_CORE_DECL(void, glVertexAttrib2f, (GLuint index, GLfloat x, GLfloat y))
ANT_GL_CORE_DECL(void, glVertexAttrib2fv, (GLuint index, const GLfloat *v))
ANT_GL_CORE_DECL(void, glVertexAttrib2s, (GLuint index, GLshort x, GLshort y))
ANT_GL_CORE_DECL(void, glVertexAttrib2sv, (GLuint index, const GLshort *v))
ANT_GL_CORE_DECL(void, glVertexAttrib3d, (GLuint index, GLdouble x, GLdouble y, GLdouble z))
ANT_GL_CORE_DECL(void, glVertexAttrib3dv, (GLuint index, const GLdouble *v))
ANT_GL_CORE_DECL(void, glVertexAttrib3f, (GLuint index, GLfloat x, GLfloat y, GLfloat z))
ANT_GL_CORE_DECL(void, glVertexAttrib3fv, (GLuint index, const GLfloat *v))
ANT_GL_CORE_DECL(void, glVertexAttrib3s, (GLuint index, GLshort x, GLshort y, GLshort z))
ANT_GL_CORE_DECL(void, glVertexAttrib3sv, (GLuint index, const GLshort *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4Nbv, (GLuint index, const GLbyte *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4Niv, (GLuint index, const GLint *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4Nsv, (GLuint index, const GLshort *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4Nub, (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w))
ANT_GL_CORE_DECL(void, glVertexAttrib4Nubv, (GLuint index, const GLubyte *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4Nuiv, (GLuint index, const GLuint *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4Nusv, (GLuint index, const GLushort *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4bv, (GLuint index, const GLbyte *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4d, (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w))
ANT_GL_CORE_DECL(void, glVertexAttrib4dv, (GLuint index, const GLdouble *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4f, (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w))
ANT_GL_CORE_DECL(void, glVertexAttrib4fv, (GLuint index, const GLfloat *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4iv, (GLuint index, const GLint *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4s, (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w))
ANT_GL_CORE_DECL(void, glVertexAttrib4sv, (GLuint index, const GLshort *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4ubv, (GLuint index, const GLubyte *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4uiv, (GLuint index, const GLuint *v))
ANT_GL_CORE_DECL(void, glVertexAttrib4usv, (GLuint index, const GLushort *v))
ANT_GL_CORE_DECL(void, glVertexAttribPointer, (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer))
/*
// GL 2.1
ANT_GL_CORE_DECL(void, glUniformMatrix2x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniformMatrix3x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniformMatrix2x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniformMatrix4x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniformMatrix3x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
ANT_GL_CORE_DECL(void, glUniformMatrix4x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
// GL 3.0
ANT_GL_CORE_DECL(void, glColorMaski, (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a))
ANT_GL_CORE_DECL(void, glGetBooleani_v, (GLenum target, GLuint index, GLboolean *data))
ANT_GL_CORE_DECL(void, glGetIntegeri_v, (GLenum target, GLuint index, GLint *data))
ANT_GL_CORE_DECL(void, glEnablei, (GLenum target, GLuint index))
ANT_GL_CORE_DECL(void, glDisablei, (GLenum target, GLuint index))
ANT_GL_CORE_DECL(GLboolean, glIsEnabledi, (GLenum target, GLuint index))
ANT_GL_CORE_DECL(void, glBeginTransformFeedback, (GLenum primitiveMode))
ANT_GL_CORE_DECL(void, glEndTransformFeedback, (void))
ANT_GL_CORE_DECL(void, glBindBufferRange, (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size))
ANT_GL_CORE_DECL(void, glBindBufferBase, (GLenum target, GLuint index, GLuint buffer))
ANT_GL_CORE_DECL(void, glTransformFeedbackVaryings, (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode))
ANT_GL_CORE_DECL(void, glGetTransformFeedbackVarying, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name))
ANT_GL_CORE_DECL(void, glClampColor, (GLenum target, GLenum clamp))
ANT_GL_CORE_DECL(void, glBeginConditionalRender, (GLuint id, GLenum mode))
ANT_GL_CORE_DECL(void, glEndConditionalRender, (void))
ANT_GL_CORE_DECL(void, glVertexAttribIPointer, (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer))
ANT_GL_CORE_DECL(void, glGetVertexAttribIiv, (GLuint index, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetVertexAttribIuiv, (GLuint index, GLenum pname, GLuint *params))
ANT_GL_CORE_DECL(void, glVertexAttribI1i, (GLuint index, GLint x))
ANT_GL_CORE_DECL(void, glVertexAttribI2i, (GLuint index, GLint x, GLint y))
ANT_GL_CORE_DECL(void, glVertexAttribI3i, (GLuint index, GLint x, GLint y, GLint z))
ANT_GL_CORE_DECL(void, glVertexAttribI4i, (GLuint index, GLint x, GLint y, GLint z, GLint w))
ANT_GL_CORE_DECL(void, glVertexAttribI1ui, (GLuint index, GLuint x))
ANT_GL_CORE_DECL(void, glVertexAttribI2ui, (GLuint index, GLuint x, GLuint y))
ANT_GL_CORE_DECL(void, glVertexAttribI3ui, (GLuint index, GLuint x, GLuint y, GLuint z))
ANT_GL_CORE_DECL(void, glVertexAttribI4ui, (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w))
ANT_GL_CORE_DECL(void, glVertexAttribI1iv, (GLuint index, const GLint *v))
ANT_GL_CORE_DECL(void, glVertexAttribI2iv, (GLuint index, const GLint *v))
ANT_GL_CORE_DECL(void, glVertexAttribI3iv, (GLuint index, const GLint *v))
ANT_GL_CORE_DECL(void, glVertexAttribI4iv, (GLuint index, const GLint *v))
ANT_GL_CORE_DECL(void, glVertexAttribI1uiv, (GLuint index, const GLuint *v))
ANT_GL_CORE_DECL(void, glVertexAttribI2uiv, (GLuint index, const GLuint *v))
ANT_GL_CORE_DECL(void, glVertexAttribI3uiv, (GLuint index, const GLuint *v))
ANT_GL_CORE_DECL(void, glVertexAttribI4uiv, (GLuint index, const GLuint *v))
ANT_GL_CORE_DECL(void, glVertexAttribI4bv, (GLuint index, const GLbyte *v))
ANT_GL_CORE_DECL(void, glVertexAttribI4sv, (GLuint index, const GLshort *v))
ANT_GL_CORE_DECL(void, glVertexAttribI4ubv, (GLuint index, const GLubyte *v))
ANT_GL_CORE_DECL(void, glVertexAttribI4usv, (GLuint index, const GLushort *v))
ANT_GL_CORE_DECL(void, glGetUniformuiv, (GLuint program, GLint location, GLuint *params))
ANT_GL_CORE_DECL(void, glBindFragDataLocation, (GLuint program, GLuint color, const GLchar *name))
ANT_GL_CORE_DECL(GLint, glGetFragDataLocation, (GLuint program, const GLchar *name))
ANT_GL_CORE_DECL(void, glUniform1ui, (GLint location, GLuint v0))
ANT_GL_CORE_DECL(void, glUniform2ui, (GLint location, GLuint v0, GLuint v1))
ANT_GL_CORE_DECL(void, glUniform3ui, (GLint location, GLuint v0, GLuint v1, GLuint v2))
ANT_GL_CORE_DECL(void, glUniform4ui, (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3))
ANT_GL_CORE_DECL(void, glUniform1uiv, (GLint location, GLsizei count, const GLuint *value))
ANT_GL_CORE_DECL(void, glUniform2uiv, (GLint location, GLsizei count, const GLuint *value))
ANT_GL_CORE_DECL(void, glUniform3uiv, (GLint location, GLsizei count, const GLuint *value))
ANT_GL_CORE_DECL(void, glUniform4uiv, (GLint location, GLsizei count, const GLuint *value))
ANT_GL_CORE_DECL(void, glTexParameterIiv, (GLenum target, GLenum pname, const GLint *params))
ANT_GL_CORE_DECL(void, glTexParameterIuiv, (GLenum target, GLenum pname, const GLuint *params))
ANT_GL_CORE_DECL(void, glGetTexParameterIiv, (GLenum target, GLenum pname, GLint *params))
ANT_GL_CORE_DECL(void, glGetTexParameterIuiv, (GLenum target, GLenum pname, GLuint *params))
ANT_GL_CORE_DECL(void, glClearBufferiv, (GLenum buffer, GLint drawbuffer, const GLint *value))
ANT_GL_CORE_DECL(void, glClearBufferuiv, (GLenum buffer, GLint drawbuffer, const GLuint *value))
ANT_GL_CORE_DECL(void, glClearBufferfv, (GLenum buffer, GLint drawbuffer, const GLfloat *value))
ANT_GL_CORE_DECL(void, glClearBufferfi, (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil))
ANT_GL_CORE_DECL(const GLubyte *, glGetStringi, (GLenum name, GLuint index))
// GL 3.1
ANT_GL_CORE_DECL(void, glDrawArraysInstanced, (GLenum mode, GLint first, GLsizei count, GLsizei primcount))
ANT_GL_CORE_DECL(void, glDrawElementsInstanced, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount))
ANT_GL_CORE_DECL(void, glTexBuffer, (GLenum target, GLenum internalformat, GLuint buffer))
ANT_GL_CORE_DECL(void, glPrimitiveRestartIndex, (GLuint index))
// GL 3.2
//typedef int64_t GLint64;
//ANT_GL_CORE_DECL(void, glGetInteger64i_v, (GLenum target, GLuint index, GLint64 *data))
//ANT_GL_CORE_DECL(void, glGetBufferParameteri64v, (GLenum target, GLenum pname, GLint64 *params))
ANT_GL_CORE_DECL(void, glFramebufferTexture, (GLenum target, GLenum attachment, GLuint texture, GLint level))
*/
// GL_ARB_vertex_array_object
ANT_GL_CORE_DECL_NO_FORWARD(void, glBindVertexArray, (GLuint array))
ANT_GL_CORE_DECL_NO_FORWARD(void, glDeleteVertexArrays, (GLsizei n, const GLuint *arrays))
ANT_GL_CORE_DECL_NO_FORWARD(void, glGenVertexArrays, (GLsizei n, GLuint *arrays))
ANT_GL_CORE_DECL_NO_FORWARD(GLboolean, glIsVertexArray, (GLuint array))
#ifdef ANT_WINDOWS
ANT_GL_CORE_DECL(PROC, wglGetProcAddress, (LPCSTR))
#endif
#ifndef GL_CLAMP_TO_EDGE
# define GL_CLAMP_TO_EDGE 0x812F
#endif
#ifndef GL_COMPILE_STATUS
# define GL_COMPILE_STATUS 0x8B81
#endif
#ifndef GL_INFO_LOG_LENGTH
# define GL_INFO_LOG_LENGTH 0x8B84
#endif
#ifndef GL_LINK_STATUS
# define GL_LINK_STATUS 0x8B82
#endif
#ifndef GL_ARRAY_BUFFER
# define GL_ARRAY_BUFFER 0x8892
#endif
#ifndef GL_DYNAMIC_DRAW
# define GL_DYNAMIC_DRAW 0x88E8
#endif
#ifndef GL_VERTEX_SHADER
# define GL_VERTEX_SHADER 0x8B31
#endif
#ifndef GL_FRAGMENT_SHADER
# define GL_FRAGMENT_SHADER 0x8B30
#endif
#ifndef GL_VERTEX_ARRAY_BINDING
# define GL_VERTEX_ARRAY_BINDING 0x85B5
#endif
#ifndef GL_CURRENT_PROGRAM
# define GL_CURRENT_PROGRAM 0x8B8D
#endif
#ifndef GL_ACTIVE_TEXTURE
# define GL_ACTIVE_TEXTURE 0x84E0
#endif
#ifndef GL_TEXTURE0
# define GL_TEXTURE0 0x84C0
#endif
#ifndef GL_BGRA
# define GL_BGRA 0x80E1
#endif
#endif // !defined ANT_LOAD_OGL_CORE_INCLUDED

View File

@@ -1,14 +1,12 @@
####### Compiler, tools and options
#---- MinGW
#MINGWFLAGS = -mno-cygwin
#SO_EXT = .dll
#---- LINUX
SO_EXT = .so
SO_VERSION = 1
#---- Release
CXXCFG = -O3
LFLAGS = -Wl,-s
LFLAGS =
OUT_DIR = ../lib
#---- Debug
#CXXCFG = -g -D_DEBUG
@@ -17,9 +15,8 @@ OUT_DIR = ../lib
CXX = gcc
#CXXFLAGS = $(CXXCFG) $(MINGWFLAGS) -pipe -Wall -fomit-frame-pointer -mcpu=pentiumpro -march=i586 -ffast-math -fno-strength-reduce -fpic -D_UNIX -D__PLACEMENT_NEW_INLINE
CXXFLAGS = $(CXXCFG) $(MINGWFLAGS) -Wall -ffast-math -mcpu=i386 -march=i386 -fPIC -D_UNIX -D__PLACEMENT_NEW_INLINE
INCPATH = -I/usr/X11R6/include -I/usr/include -I../include
CXXFLAGS = $(CXXCFG) -Wall -fPIC -fno-strict-aliasing -D_UNIX -D__PLACEMENT_NEW_INLINE
INCPATH = -I../include -I/usr/local/include -I/usr/X11R6/include -I/usr/include
LINK = gcc
#LIBS = -L/usr/X11R6/lib -L. -lglfw -lGL -lGLU -lX11 -lXxf86vm -lXext -lpthread -lm
#LIBS = -L/usr/X11R6/lib -lGL -lX11 -lXxf86vm -lXext -lpthread -lm
@@ -42,10 +39,10 @@ NO_STDERR = 2> /dev/null
# name of the application:
TARGET = AntTweakBar
TARGET = AntTweakBar
# source files without extension:
SRC_FILES = TwColors.cpp TwFonts.cpp TwOpenGL.cpp TwBar.cpp TwMgr.cpp TwPrecomp.cpp LoadOGL.cpp TwEventGLFW.c TwEventGLUT.c TwEventSDL.c
SRC_FILES = TwColors.cpp TwFonts.cpp TwOpenGL.cpp TwOpenGLCore.cpp TwBar.cpp TwMgr.cpp TwPrecomp.cpp LoadOGL.cpp LoadOGLCore.cpp TwEventGLFW.c TwEventGLUT.c TwEventSDL.c TwEventSDL12.c TwEventSDL13.c TwEventSFML.cpp TwEventX11.c
# build object list from source files
OBJS_1 = $(SRC_FILES:.c=.o)
@@ -68,7 +65,8 @@ all: Makefile $(TARGET)
$(TARGET): $(OBJS)
@echo "===== Link $@ ====="
$(LINK) $(LFLAGS) -shared -Wl,-soname,lib$(TARGET)$(SO_EXT) -o $(OUT_DIR)/lib$(TARGET)$(SO_EXT) $(OBJS) $(LIBS)
$(LINK) $(LFLAGS) -shared -Wl,-soname,lib$(TARGET)$(SO_EXT).$(SO_VERSION) -o $(OUT_DIR)/lib$(TARGET)$(SO_EXT) $(OBJS) $(LIBS)
$(SYMLINK) $(OUT_DIR)/lib$(TARGET)$(SO_EXT) $(OUT_DIR)/lib$(TARGET)$(SO_EXT).$(SO_VERSION)
.cpp.o:
@echo "===== Compile $< ====="
@@ -89,10 +87,14 @@ clean:
TwColors.o: TwPrecomp.h TwColors.h
TwFonts.o: TwPrecomp.h ../include/AntTweakBar.h TwFonts.h TwMgr.h TwColors.h TwGraph.h AntPerfTimer.h
TwOpenGL.o: TwPrecomp.h ../include/AntTweakBar.h TwOpenGL.h LoadOGL.h TwGraph.h TwColors.h TwFonts.h TwMgr.h AntPerfTimer.h
TwOpenGLCore.o: TwPrecomp.h ../include/AntTweakBar.h TwOpenGLCore.h LoadOGLCore.h TwGraph.h TwColors.h TwFonts.h TwMgr.h AntPerfTimer.h
TwBar.o: TwPrecomp.h ../include/AntTweakBar.h TwBar.h TwMgr.h TwColors.h TwFonts.h TwGraph.h AntPerfTimer.h
TwMgr.o: TwPrecomp.h ../include/AntTweakBar.h TwMgr.h TwColors.h TwFonts.h TwGraph.h AntPerfTimer.h TwBar.h TwOpenGL.h res/TwXCursors.h
TwPrecomp.o: TwPrecomp.h
LoadOGL.o: TwPrecomp.h LoadOGL.h
TwEventGLFW.o: ../include/AntTweakBar.h
TwEventGLUT.o: ../include/AntTweakBar.h
TwEventGLFW.o: ../include/AntTweakBar.h MiniGLFW.h
TwEventGLUT.o: ../include/AntTweakBar.h MiniGLUT.h
TwEventSDL.o: ../include/AntTweakBar.h
TwEventSDL12.o: ../include/AntTweakBar.h MiniSDL12.h
TwEventSDL13.o: ../include/AntTweakBar.h MiniSDL13.h
TwEventX11.o: ../include/AntTweakBar.h

View File

@@ -0,0 +1,142 @@
// ---------------------------------------------------------------------------
//
// @file MiniGLUT.h
// @brief A subset of GLUT definitions needed to compile helper functions
// implemented in TwEventGLUT.c
//
// notes: - Private header
// - AntTweakBar.dll does not need to link with GLUT,
// it just needs some definitions for its helper functions.
// - This header is provided to avoid the need of having GLUT
// installed to recompile AntTweakBar.
// - Do not use this header in your own programs, better use the
// GLUT.h header from the actual GLUT library SDK :
// http://opengl.org/resources/libraries/glut
//
// ---------------------------------------------------------------------------
#if !defined MINI_GLUT_INCLUDED
#define MINI_GLUT_INCLUDED
#if defined(_WIN32) || defined(_WIN64)
# define WIN32_LEAN_AND_MEAN
# include <windows.h> // needed by gl.h
# define GLUT_CALL __stdcall
# define GLUT_CALLBACK __cdecl
# define GLUT_API __declspec(dllimport)
#else
# define GLUT_CALL
# define GLUT_CALLBACK
# define GLUT_API extern
#endif
#if defined(_MACOSX)
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
#else
# include <GL/gl.h> // must be included after windows.h
# include <GL/glu.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
// Mouse buttons
#define GLUT_LEFT_BUTTON 0
#define GLUT_MIDDLE_BUTTON 1
#define GLUT_RIGHT_BUTTON 2
// Mouse button state
#define GLUT_DOWN 0
#define GLUT_UP 1
// glutGetModifiers return mask
#define GLUT_ACTIVE_SHIFT 1
#define GLUT_ACTIVE_CTRL 2
#define GLUT_ACTIVE_ALT 4
// function keys
#define GLUT_KEY_F1 1
#define GLUT_KEY_F2 2
#define GLUT_KEY_F3 3
#define GLUT_KEY_F4 4
#define GLUT_KEY_F5 5
#define GLUT_KEY_F6 6
#define GLUT_KEY_F7 7
#define GLUT_KEY_F8 8
#define GLUT_KEY_F9 9
#define GLUT_KEY_F10 10
#define GLUT_KEY_F11 11
#define GLUT_KEY_F12 12
// directional keys
#define GLUT_KEY_LEFT 100
#define GLUT_KEY_UP 101
#define GLUT_KEY_RIGHT 102
#define GLUT_KEY_DOWN 103
#define GLUT_KEY_PAGE_UP 104
#define GLUT_KEY_PAGE_DOWN 105
#define GLUT_KEY_HOME 106
#define GLUT_KEY_END 107
#define GLUT_KEY_INSERT 108
// display mode bit masks
#define GLUT_RGB 0
#define GLUT_RGBA GLUT_RGB
#define GLUT_INDEX 1
#define GLUT_SINGLE 0
#define GLUT_DOUBLE 2
#define GLUT_ACCUM 4
#define GLUT_ALPHA 8
#define GLUT_DEPTH 16
#define GLUT_STENCIL 32
// timer
#define GLUT_ELAPSED_TIME ((GLenum) 700)
// functions subset
GLUT_API void GLUT_CALL glutInit(int *argcp, char **argv);
GLUT_API void GLUT_CALL glutInitDisplayMode(unsigned int mode);
GLUT_API int GLUT_CALL glutCreateWindow(const char *title);
GLUT_API int GLUT_CALL glutGetWindow(void);
GLUT_API void GLUT_CALL glutSetWindow(int win);
GLUT_API int GLUT_CALL glutCreateSubWindow(int win, int x, int y, int width, int height);
GLUT_API int GLUT_CALL glutGet(GLenum type);
GLUT_API void GLUT_CALL glutSwapBuffers();
GLUT_API void GLUT_CALL glutPostRedisplay();
GLUT_API void GLUT_CALL glutInitWindowPosition(int x, int y);
GLUT_API void GLUT_CALL glutInitWindowSize(int width, int height);
GLUT_API void GLUT_CALL glutPositionWindow(int x, int y);
GLUT_API void GLUT_CALL glutReshapeWindow(int width, int height);
GLUT_API void GLUT_CALL glutMainLoop();
GLUT_API int GLUT_CALL glutCreateMenu(void (GLUT_CALLBACK *func)(int));
GLUT_API void GLUT_CALL glutDisplayFunc(void (GLUT_CALLBACK *func)(void));
GLUT_API void GLUT_CALL glutReshapeFunc(void (GLUT_CALLBACK *func)(int width, int height));
GLUT_API void GLUT_CALL glutKeyboardFunc(void (GLUT_CALLBACK *func)(unsigned char key, int x, int y));
GLUT_API void GLUT_CALL glutMouseFunc(void (GLUT_CALLBACK *func)(int button, int state, int x, int y));
GLUT_API void GLUT_CALL glutMotionFunc(void (GLUT_CALLBACK *func)(int x, int y));
GLUT_API void GLUT_CALL glutPassiveMotionFunc(void (GLUT_CALLBACK *func)(int x, int y));
GLUT_API void GLUT_CALL glutSpecialFunc(void (GLUT_CALLBACK *func)(int key, int x, int y));
GLUT_API int GLUT_CALL glutGetModifiers(void);
GLUT_API void GLUT_CALL glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUT_API void GLUT_CALL glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUT_API void GLUT_CALL glutSolidTeapot(GLdouble size);
// GLUT exit problem workaround (see glut.h)
#if (defined(_WIN32) || defined(_WIN64)) && !defined(GLUT_DISABLE_ATEXIT_HACK)
extern void __cdecl exit(int);
GLUT_API void GLUT_CALL __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
static void GLUT_CALL glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
#define glutInit glutInit_ATEXIT_HACK
#endif
#ifdef __cplusplus
}
#endif
#endif // !defined MINI_GLUT_INCLUDED

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,14 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwBar.h
// @brief Tweak bar manager.
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwBar.h
// @brief Tweak bar and var classes.
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// note: Private header
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_TW_BAR_INCLUDED
@@ -19,319 +17,422 @@
#include <AntTweakBar.h>
#include "TwColors.h"
#define ANT_TWEAK_BAR_DLL "AntTweakBar"
#define ANT_TWEAK_BAR_DLL "AntTweakBar"
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
bool IsCustomType(int _Type);
struct CTwVar
{
std::string m_Name;
std::string m_Label;
std::string m_Help;
bool m_IsRoot;
bool m_DontClip;
bool m_Visible;
signed short m_LeftMargin;
signed short m_TopMargin;
color32 m_Color;
std::string m_Name;
std::string m_Label;
std::string m_Help;
bool m_IsRoot;
bool m_DontClip;
bool m_Visible;
signed short m_LeftMargin;
signed short m_TopMargin;
const color32 * m_ColorPtr;
const color32 * m_BgColorPtr;
virtual bool IsGroup() const = 0;
virtual const CTwVar * Find(const char *_Name, struct CTwVarGroup **_Parent, int *_Index) const = 0;
virtual int HasAttrib(const char *_Attrib, bool *_HasValue) const;
virtual int SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex);
virtual void SetReadOnly(bool _ReadOnly) = 0;
CTwVar() { m_IsRoot = false; m_DontClip = false; m_Visible = true; m_LeftMargin = 0; m_TopMargin = 0; m_Color = COLOR32_BLACK; }
virtual ~CTwVar() {}
virtual bool IsGroup() const = 0;
virtual bool IsCustom() const { return false; }
virtual const CTwVar * Find(const char *_Name, struct CTwVarGroup **_Parent, int *_Index) const = 0;
virtual int HasAttrib(const char *_Attrib, bool *_HasValue) const;
virtual int SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex);
virtual ERetType GetAttrib(int _AttribID, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex, std::vector<double>& outDouble, std::ostringstream& outString) const;
virtual void SetReadOnly(bool _ReadOnly) = 0;
virtual bool IsReadOnly() const = 0;
CTwVar();
virtual ~CTwVar() {}
static size_t GetDataSize(TwType _Type);
static size_t GetDataSize(TwType _Type);
};
struct CTwVarAtom : CTwVar
{
ETwType m_Type;
void * m_Ptr;
TwSetVarCallback m_SetCallback;
TwGetVarCallback m_GetCallback;
TwButtonCallback m_ButtonCallback;
void * m_ClientData;
bool m_ReadOnly;
bool m_NoSlider;
int m_KeyIncr[2]; // [0]=key_code [1]=modifiers
int m_KeyDecr[2]; // [0]=key_code [1]=modifiers
ETwType m_Type;
void * m_Ptr;
TwSetVarCallback m_SetCallback;
TwGetVarCallback m_GetCallback;
void * m_ClientData;
bool m_ReadOnly;
bool m_NoSlider;
int m_KeyIncr[2]; // [0]=key_code [1]=modifiers
int m_KeyDecr[2]; // [0]=key_code [1]=modifiers
template <typename _T> struct TVal
{
_T m_Min;
_T m_Max;
_T m_Step;
signed char m_Precision;
bool m_Hexa;
};
union UVal
{
TVal<unsigned char> m_Char;
TVal<signed char> m_Int8;
TVal<unsigned char> m_UInt8;
TVal<signed short> m_Int16;
TVal<unsigned short>m_UInt16;
TVal<signed int> m_Int32;
TVal<unsigned int> m_UInt32;
TVal<float> m_Float32;
TVal<double> m_Float64;
struct CBoolVal
{
char * m_TrueString;
char * m_FalseString;
bool m_FreeTrueString;
bool m_FreeFalseString;
} m_Bool;
struct CEnumVal // empty -> enum entries are deduced from m_Type
{
//typedef std::map<unsigned int, std::string> CEntries;
//CEntries * m_Entries;
} m_Enum;
struct CShortcutVal
{
int m_Incr[2];
int m_Decr[2];
} m_Shortcut;
struct CHelpStruct
{
int m_StructType;
} m_HelpStruct;
};
UVal m_Val;
template <typename _T> struct TVal
{
_T m_Min;
_T m_Max;
_T m_Step;
signed char m_Precision;
bool m_Hexa;
};
union UVal
{
TVal<unsigned char> m_Char;
TVal<signed char> m_Int8;
TVal<unsigned char> m_UInt8;
TVal<signed short> m_Int16;
TVal<unsigned short>m_UInt16;
TVal<signed int> m_Int32;
TVal<unsigned int> m_UInt32;
TVal<float> m_Float32;
TVal<double> m_Float64;
struct CBoolVal
{
char * m_TrueString;
char * m_FalseString;
bool m_FreeTrueString;
bool m_FreeFalseString;
} m_Bool;
struct CEnumVal // empty -> enum entries are deduced from m_Type
{
//typedef std::map<unsigned int, std::string> CEntries;
//CEntries * m_Entries;
} m_Enum;
struct CShortcutVal
{
int m_Incr[2];
int m_Decr[2];
} m_Shortcut;
struct CHelpStruct
{
int m_StructType;
} m_HelpStruct;
struct CButtonVal
{
TwButtonCallback m_Callback;
int m_Separator;
} m_Button;
struct CCustomVal
{
CTwMgr::CMemberProxy *m_MemberProxy;
} m_Custom;
};
UVal m_Val;
virtual bool IsGroup() const { return false; }
virtual void ValueToString(std::string *_Str) const;
virtual double ValueToDouble() const;
virtual void ValueFromDouble(double _Val);
virtual void MinMaxStepToDouble(double *_Min, double *_Max, double *_Step) const;
virtual const CTwVar * Find(const char *_Name, struct CTwVarGroup **_Parent, int *_Index) const;
virtual int HasAttrib(const char *_Attrib, bool *_HasValue) const;
virtual int SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex);
virtual void Increment(int _Step);
virtual void SetDefaults();
virtual void SetReadOnly(bool _ReadOnly) { if(_ReadOnly || m_SetCallback || m_Ptr) m_ReadOnly=_ReadOnly; }
//virtual int DefineEnum(const TwEnumVal *_EnumValues, unsigned int _NbValues);
CTwVarAtom();
virtual ~CTwVarAtom();
virtual bool IsGroup() const { return false; }
virtual bool IsCustom() const { return IsCustomType(m_Type); }
virtual void ValueToString(std::string *_Str) const;
virtual double ValueToDouble() const;
virtual void ValueFromDouble(double _Val);
virtual void MinMaxStepToDouble(double *_Min, double *_Max, double *_Step) const;
virtual const CTwVar * Find(const char *_Name, struct CTwVarGroup **_Parent, int *_Index) const;
virtual int HasAttrib(const char *_Attrib, bool *_HasValue) const;
virtual int SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex);
virtual ERetType GetAttrib(int _AttribID, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex, std::vector<double>& outDouble, std::ostringstream& outString) const;
virtual void Increment(int _Step);
virtual void SetDefaults();
virtual void SetReadOnly(bool _ReadOnly) { m_ReadOnly=_ReadOnly; if( m_Type!=TW_TYPE_BUTTON && m_SetCallback==NULL && m_Ptr==NULL ) m_ReadOnly=true; }
virtual bool IsReadOnly() const { if( m_Type!=TW_TYPE_BUTTON && m_SetCallback==NULL && m_Ptr==NULL ) return true; else return m_ReadOnly; }
//virtual int DefineEnum(const TwEnumVal *_EnumValues, unsigned int _NbValues);
CTwVarAtom();
virtual ~CTwVarAtom();
};
struct CTwVarGroup : CTwVar
{
std::vector<CTwVar *> m_Vars;
bool m_Open;
TwSummaryCallback m_SummaryCallback;
void * m_SummaryClientData;
void * m_StructValuePtr;
TwType m_StructType;
std::vector<CTwVar *> m_Vars;
bool m_Open;
TwSummaryCallback m_SummaryCallback;
void * m_SummaryClientData;
void * m_StructValuePtr;
TwType m_StructType;
virtual bool IsGroup() const { return true; }
virtual const CTwVar * Find(const char *_Name, CTwVarGroup **_Parent, int *_Index) const;
virtual int HasAttrib(const char *_Attrib, bool *_HasValue) const;
virtual int SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex);
virtual CTwVarAtom * FindShortcut(int _Key, int _Modifiers, bool *_DoIncr);
virtual void SetReadOnly(bool _ReadOnly) { for(size_t i=0; i<m_Vars.size(); ++i) if(m_Vars[i]) m_Vars[i]->SetReadOnly(_ReadOnly); }
CTwVarGroup() { m_Open=false; m_StructType=TW_TYPE_UNDEF; m_SummaryCallback=NULL; m_SummaryClientData=NULL; m_StructValuePtr=NULL; }
virtual ~CTwVarGroup();
virtual bool IsGroup() const { return true; }
virtual const CTwVar * Find(const char *_Name, CTwVarGroup **_Parent, int *_Index) const;
virtual int HasAttrib(const char *_Attrib, bool *_HasValue) const;
virtual int SetAttrib(int _AttribID, const char *_Value, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex);
virtual ERetType GetAttrib(int _AttribID, TwBar *_Bar, struct CTwVarGroup *_VarParent, int _VarIndex, std::vector<double>& outDouble, std::ostringstream& outString) const;
virtual CTwVarAtom * FindShortcut(int _Key, int _Modifiers, bool *_DoIncr);
virtual void SetReadOnly(bool _ReadOnly) { for(size_t i=0; i<m_Vars.size(); ++i) if(m_Vars[i]) m_Vars[i]->SetReadOnly(_ReadOnly); }
virtual bool IsReadOnly() const { for(size_t i=0; i<m_Vars.size(); ++i) if(m_Vars[i] && !m_Vars[i]->IsReadOnly()) return false; return true; }
CTwVarGroup() { m_Open=false; m_StructType=TW_TYPE_UNDEF; m_SummaryCallback=NULL; m_SummaryClientData=NULL; m_StructValuePtr=NULL; }
virtual ~CTwVarGroup();
};
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
struct CTwBar
{
std::string m_Name;
std::string m_Label;
std::string m_Help;
bool m_Visible;
int m_PosX;
int m_PosY;
int m_Width;
int m_Height;
color32 m_Color;
const CTexFont * m_Font;
int m_ValuesWidth;
int m_Sep;
int m_FirstLine;
float m_UpdatePeriod;
bool m_IsHelpBar;
int m_MinNumber; // accessed by TwDeleteBar
bool m_IsPopupList;
CTwVarAtom * m_VarEnumLinkedToPopupList;
CTwBar * m_BarLinkedToPopupList;
std::string m_Name;
std::string m_Label;
std::string m_Help;
bool m_Visible;
int m_PosX;
int m_PosY;
int m_Width;
int m_Height;
color32 m_Color;
bool m_DarkText;
const CTexFont * m_Font;
int m_ValuesWidth;
int m_Sep;
int m_LineSep;
int m_FirstLine;
float m_UpdatePeriod;
bool m_IsHelpBar;
int m_MinNumber; // accessed by TwDeleteBar
bool m_IsPopupList;
CTwVarAtom * m_VarEnumLinkedToPopupList;
CTwBar * m_BarLinkedToPopupList;
bool m_Resizable;
bool m_Movable;
bool m_Iconifiable;
bool m_Contained;
CTwVarGroup m_VarRoot;
CTwVarGroup m_VarRoot;
void NotUpToDate();
void Draw();
const CTwVar * Find(const char *_Name, CTwVarGroup **_Parent=NULL, int *_Index=NULL) const;
CTwVar * Find(const char *_Name, CTwVarGroup **_Parent=NULL, int *_Index=NULL);
int HasAttrib(const char *_Attrib, bool *_HasValue) const;
int SetAttrib(int _AttribID, const char *_Value);
bool MouseMotion(int _X, int _Y);
bool MouseButton(ETwMouseButtonID _Button, bool _Pressed, int _X, int _Y);
bool MouseWheel(int _Pos, int _PrevPos, int _MouseX, int _MouseY);
bool KeyPressed(int _Key, int _Modifiers);
bool IsMinimized() const { return m_IsMinimized; }
bool Show(CTwVar *_Var); // display the line associated to _Var
bool OpenHier(CTwVarGroup *_Root, CTwVar *_Var); // open a hierarchy if it contains _Var
int LineInHier(CTwVarGroup *_Root, CTwVar *_Var); // returns the number of the line associated to _Var
void UnHighlightLine() { m_HighlightedLine = -1; NotUpToDate(); } // used by PopupCallback
CTwBar(const char *_Name);
~CTwBar();
enum EDrawPart { DRAW_BG=(1<<0), DRAW_CONTENT=(1<<1), DRAW_ALL=DRAW_BG|DRAW_CONTENT };
void Draw(int _DrawPart=DRAW_ALL);
void NotUpToDate();
const CTwVar * Find(const char *_Name, CTwVarGroup **_Parent=NULL, int *_Index=NULL) const;
CTwVar * Find(const char *_Name, CTwVarGroup **_Parent=NULL, int *_Index=NULL);
int HasAttrib(const char *_Attrib, bool *_HasValue) const;
int SetAttrib(int _AttribID, const char *_Value);
ERetType GetAttrib(int _AttribID, std::vector<double>& outDouble, std::ostringstream& outString) const;
bool MouseMotion(int _X, int _Y);
bool MouseButton(ETwMouseButtonID _Button, bool _Pressed, int _X, int _Y);
bool MouseWheel(int _Pos, int _PrevPos, int _MouseX, int _MouseY);
bool KeyPressed(int _Key, int _Modifiers);
bool KeyTest(int _Key, int _Modifiers);
bool IsMinimized() const { return m_IsMinimized; }
bool IsDragging() const { return m_MouseDrag; }
bool Show(CTwVar *_Var); // display the line associated to _Var
bool OpenHier(CTwVarGroup *_Root, CTwVar *_Var); // open a hierarchy if it contains _Var
int LineInHier(CTwVarGroup *_Root, CTwVar *_Var); // returns the number of the line associated to _Var
void UnHighlightLine() { m_HighlightedLine = -1; NotUpToDate(); } // used by PopupCallback
void HaveFocus(bool _Focus) { m_DrawHandles = _Focus; } // used by PopupCallback
void StopEditInPlace() { if( m_EditInPlace.m_Active ) EditInPlaceEnd(false); }
CTwBar(const char *_Name);
~CTwBar();
color32 m_ColBg, m_ColBg1, m_ColBg2;
color32 m_ColHighBg;
color32 m_ColLabelText;
color32 m_ColStructText;
color32 m_ColValBg;
color32 m_ColValText;
color32 m_ColValTextRO;
color32 m_ColValMin;
color32 m_ColValMax;
color32 m_ColStructBg;
color32 m_ColTitleBg;
color32 m_ColTitleHighBg;
color32 m_ColTitleText;
color32 m_ColTitleShadow;
color32 m_ColLine;
color32 m_ColLineShadow;
color32 m_ColUnderline;
color32 m_ColBtn;
color32 m_ColHighBtn;
color32 m_ColGrpBg;
color32 m_ColGrpText;
color32 m_ColHierBg;
color32 m_ColShortcutText;
color32 m_ColShortcutBg;
color32 m_ColInfoText;
color32 m_ColHelpBg;
color32 m_ColHelpText;
color32 m_ColRoto;
color32 m_ColRotoVal;
color32 m_ColRotoBound;
void UpdateColors();
color32 m_ColBg, m_ColBg1, m_ColBg2;
color32 m_ColHighBg0;
color32 m_ColHighBg1;
color32 m_ColLabelText;
color32 m_ColStructText;
color32 m_ColValBg;
color32 m_ColValText;
color32 m_ColValTextRO;
color32 m_ColValTextNE;
color32 m_ColValMin;
color32 m_ColValMax;
color32 m_ColStructBg;
color32 m_ColTitleBg;
color32 m_ColTitleHighBg;
color32 m_ColTitleUnactiveBg;
color32 m_ColTitleText;
color32 m_ColTitleShadow;
color32 m_ColLine;
color32 m_ColLineShadow;
color32 m_ColUnderline;
color32 m_ColBtn;
color32 m_ColHighBtn;
color32 m_ColFold;
color32 m_ColHighFold;
color32 m_ColGrpBg;
color32 m_ColGrpText;
color32 m_ColHierBg;
color32 m_ColShortcutText;
color32 m_ColShortcutBg;
color32 m_ColInfoText;
color32 m_ColHelpBg;
color32 m_ColHelpText;
color32 m_ColRoto;
color32 m_ColRotoVal;
color32 m_ColRotoBound;
color32 m_ColEditBg;
color32 m_ColEditText;
color32 m_ColEditSelBg;
color32 m_ColEditSelText;
color32 m_ColSeparator;
color32 m_ColStaticText;
void UpdateColors();
protected:
int m_TitleWidth;
int m_VarX0;
int m_VarX1;
int m_VarX2;
int m_VarY0;
int m_VarY1;
int m_VarY2;
int m_ScrollYW;
int m_ScrollYH;
int m_ScrollY0;
int m_ScrollY1;
int m_NbHierLines;
int m_NbDisplayedLines;
bool m_UpToDate;
float m_LastUpdateTime;
void Update();
int m_TitleWidth;
int m_VarX0;
int m_VarX1;
int m_VarX2;
int m_VarY0;
int m_VarY1;
int m_VarY2;
int m_ScrollYW;
int m_ScrollYH;
int m_ScrollY0;
int m_ScrollY1;
int m_NbHierLines;
int m_NbDisplayedLines;
bool m_UpToDate;
float m_LastUpdateTime;
void Update();
bool m_MouseDrag;
bool m_MouseDragVar;
bool m_MouseDragTitle;
bool m_MouseDragScroll;
bool m_MouseDragResizeUR;
bool m_MouseDragResizeUL;
bool m_MouseDragResizeLR;
bool m_MouseDragResizeLL;
bool m_MouseDragValWidth;
int m_MouseOriginX;
int m_MouseOriginY;
bool m_VarHasBeenIncr;
int m_FirstLine0;
int m_HighlightedLine;
int m_HighlightedLinePrev;
bool m_HighlightIncrBtn;
bool m_HighlightDecrBtn;
bool m_HighlightClickBtn;
bool m_HighlightTitle;
bool m_HighlightScroll;
bool m_HighlightUpScroll;
bool m_HighlightDnScroll;
bool m_HighlightMinimize;
bool m_HighlightFont;
bool m_HighlightValWidth;
bool m_DrawHandles;
bool m_MouseDrag;
bool m_MouseDragVar;
bool m_MouseDragTitle;
bool m_MouseDragScroll;
bool m_MouseDragResizeUR;
bool m_MouseDragResizeUL;
bool m_MouseDragResizeLR;
bool m_MouseDragResizeLL;
bool m_MouseDragValWidth;
int m_MouseOriginX;
int m_MouseOriginY;
double m_ValuesWidthRatio;
bool m_VarHasBeenIncr;
int m_FirstLine0;
int m_HighlightedLine;
int m_HighlightedLinePrev;
int m_HighlightedLineLastValid;
bool m_HighlightIncrBtn;
bool m_HighlightDecrBtn;
bool m_HighlightRotoBtn;
bool m_HighlightListBtn;
bool m_HighlightBoolBtn;
bool m_HighlightClickBtn;
double m_HighlightClickBtnAuto;
bool m_HighlightTitle;
bool m_HighlightScroll;
bool m_HighlightUpScroll;
bool m_HighlightDnScroll;
bool m_HighlightMinimize;
bool m_HighlightFont;
bool m_HighlightValWidth;
bool m_HighlightLabelsHeader;
bool m_HighlightValuesHeader;
bool m_DrawHandles;
bool m_IsMinimized;
int m_MinPosX;
int m_MinPosY;
bool m_HighlightMaximize;
bool m_DrawIncrDecrBtn;
bool m_DrawClickBtn;
bool m_IsMinimized;
int m_MinPosX;
int m_MinPosY;
bool m_HighlightMaximize;
bool m_DrawIncrDecrBtn;
bool m_DrawRotoBtn;
bool m_DrawClickBtn;
bool m_DrawListBtn;
bool m_DrawBoolBtn;
EButtonAlign m_ButtonAlign;
struct CHierTag
{
CTwVar * m_Var;
int m_Level;
bool m_Closing;
};
std::vector<CHierTag> m_HierTags;
void BrowseHierarchy(int *_LineNum, int _CurrLevel, const CTwVar *_Var, int _First, int _Last);
void * m_TitleTextObj;
void * m_LabelsTextObj;
void * m_ValuesTextObj;
void * m_ShortcutTextObj;
int m_ShortcutLine;
void ListLabels(std::vector<std::string>& _Labels, std::vector<color32>& _Colors, const CTexFont *_Font, int _AtomWidthMax, int _GroupWidthMax);
void ListValues(std::vector<std::string>& _Values, std::vector<color32>& _Colors, std::vector<color32>& _BgColors, const CTexFont *_Font, int _WidthMax);
void DrawHierHandle();
struct CHierTag
{
CTwVar * m_Var;
int m_Level;
bool m_Closing;
};
std::vector<CHierTag> m_HierTags;
void BrowseHierarchy(int *_LineNum, int _CurrLevel, const CTwVar *_Var, int _First, int _Last);
void * m_TitleTextObj;
void * m_LabelsTextObj;
void * m_ValuesTextObj;
void * m_ShortcutTextObj;
int m_ShortcutLine;
void * m_HeadersTextObj;
void ListLabels(std::vector<std::string>& _Labels, std::vector<color32>& _Colors, std::vector<color32>& _BgColors, bool *_HasBgColors, const CTexFont *_Font, int _AtomWidthMax, int _GroupWidthMax);
void ListValues(std::vector<std::string>& _Values, std::vector<color32>& _Colors, std::vector<color32>& _BgColors, const CTexFont *_Font, int _WidthMax);
int ComputeLabelsWidth(const CTexFont *_Font);
int ComputeValuesWidth(const CTexFont *_Font);
void DrawHierHandle();
enum EValuesWidthFit { VALUES_WIDTH_FIT = -5555 };
// RotoSlider
struct CPoint
{
int x, y;
CPoint() {}
CPoint(int _X, int _Y):x(_X), y(_Y) {}
const CPoint operator+ (const CPoint& p) const { return CPoint(x+p.x, y+p.y); }
const CPoint operator- (const CPoint& p) const { return CPoint(x-p.x, y-p.y); }
};
struct CRotoSlider
{
CRotoSlider();
CTwVarAtom * m_Var;
double m_PreciseValue;
double m_CurrentValue;
double m_Value0;
double m_ValueAngle0;
bool m_Active;
bool m_ActiveMiddle;
CPoint m_Origin;
CPoint m_Current;
bool m_HasPrevious;
CPoint m_Previous;
double m_Angle0;
double m_AngleDT;
int m_Subdiv;
};
CRotoSlider m_Roto;
int m_RotoMinRadius;
int m_RotoNbSubdiv; // number of steps for one turn
void RotoDraw();
void RotoOnMouseMove(int _X, int _Y);
void RotoOnLButtonDown(int _X, int _Y);
void RotoOnLButtonUp(int _X, int _Y);
void RotoOnMButtonDown(int _X, int _Y);
void RotoOnMButtonUp(int _X, int _Y);
double RotoGetValue() const;
void RotoSetValue(double _Val);
double RotoGetMin() const;
double RotoGetMax() const;
double RotoGetStep() const;
double RotoGetSteppedValue() const;
// RotoSlider
struct CPoint
{
int x, y;
CPoint() {}
CPoint(int _X, int _Y):x(_X), y(_Y) {}
const CPoint operator+ (const CPoint& p) const { return CPoint(x+p.x, y+p.y); }
const CPoint operator- (const CPoint& p) const { return CPoint(x-p.x, y-p.y); }
};
struct CRotoSlider
{
CRotoSlider();
CTwVarAtom * m_Var;
double m_PreciseValue;
double m_CurrentValue;
double m_Value0;
double m_ValueAngle0;
bool m_Active;
bool m_ActiveMiddle;
CPoint m_Origin;
CPoint m_Current;
bool m_HasPrevious;
CPoint m_Previous;
double m_Angle0;
double m_AngleDT;
int m_Subdiv;
};
CRotoSlider m_Roto;
int m_RotoMinRadius;
int m_RotoNbSubdiv; // number of steps for one turn
void RotoDraw();
void RotoOnMouseMove(int _X, int _Y);
void RotoOnLButtonDown(int _X, int _Y);
void RotoOnLButtonUp(int _X, int _Y);
void RotoOnMButtonDown(int _X, int _Y);
void RotoOnMButtonUp(int _X, int _Y);
double RotoGetValue() const;
void RotoSetValue(double _Val);
double RotoGetMin() const;
double RotoGetMax() const;
double RotoGetStep() const;
double RotoGetSteppedValue() const;
friend struct CTwMgr;
// Edit-in-place
struct CEditInPlace
{
CEditInPlace();
~CEditInPlace();
CTwVarAtom * m_Var;
bool m_Active;
std::string m_String;
void * m_EditTextObj;
void * m_EditSelTextObj;
int m_CaretPos;
int m_SelectionStart;
int m_X, m_Y;
int m_Width;
int m_FirstChar;
std::string m_Clipboard;
};
CEditInPlace m_EditInPlace;
void EditInPlaceDraw();
bool EditInPlaceAcceptVar(const CTwVarAtom* _Var);
bool EditInPlaceIsReadOnly();
void EditInPlaceStart(CTwVarAtom* _Var, int _X, int _Y, int _Width);
void EditInPlaceEnd(bool _Commit);
bool EditInPlaceKeyPressed(int _Key, int _Modifiers);
bool EditInPlaceEraseSelect();
bool EditInPlaceMouseMove(int _X, int _Y, bool _Select);
bool EditInPlaceSetClipboard(const std::string& _String);
bool EditInPlaceGetClipboard(std::string *_OutString);
struct CCustomRecord
{
int m_IndexMin;
int m_IndexMax;
int m_XMin, m_XMax;
int m_YMin, m_YMax; // Y visible range
int m_Y0, m_Y1; // Y widget range
CTwVarGroup * m_Var;
};
typedef std::map<CTwMgr::CStructProxy*, CCustomRecord> CustomMap;
CustomMap m_CustomRecords;
CTwMgr::CStructProxy * m_CustomActiveStructProxy;
friend struct CTwMgr;
};
// ---------------------------------------------------------------------------
void DrawArc(int _X, int _Y, int _Radius, float _StartAngleDeg, float _EndAngleDeg, color32 _Color);
// ---------------------------------------------------------------------------
#endif // !defined ANT_TW_BAR_INCLUDED

View File

@@ -1,161 +1,153 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwColors.cpp
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwColors.cpp
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// note: TAB=4
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#include "TwPrecomp.h"
#include "TwColors.h"
typedef float float32;
typedef int int32;
void ColorRGBToHLSf(float32 _R, float32 _G, float32 _B, float32 *_Hue, float32 *_Light, float32 *_Saturation)
void ColorRGBToHLSf(float _R, float _G, float _B, float *_Hue, float *_Light, float *_Saturation)
{
// Compute HLS from RGB. The r,g,b triplet is between [0,1],
// hue is between [0,360], light and saturation are [0,1].
// Compute HLS from RGB. The r,g,b triplet is between [0,1],
// hue is between [0,360], light and saturation are [0,1].
float32 rnorm, gnorm, bnorm, minval, maxval, msum, mdiff, r, g, b;
r = g = b = 0;
if(_R>0) r = _R; if(r>1) r = 1;
if(_G>0) g = _G; if(g>1) g = 1;
if(_B>0) b = _B; if(b>1) b = 1;
float rnorm, gnorm, bnorm, minval, maxval, msum, mdiff, r, g, b;
r = g = b = 0;
if(_R>0) r = _R; if(r>1) r = 1;
if(_G>0) g = _G; if(g>1) g = 1;
if(_B>0) b = _B; if(b>1) b = 1;
minval = r;
if(g<minval) minval = g;
if(b<minval) minval = b;
maxval = r;
if(g>maxval) maxval = g;
if(b>maxval) maxval = b;
minval = r;
if(g<minval) minval = g;
if(b<minval) minval = b;
maxval = r;
if(g>maxval) maxval = g;
if(b>maxval) maxval = b;
rnorm = gnorm = bnorm = 0;
mdiff = maxval - minval;
msum = maxval + minval;
float32 l = 0.5f * msum;
if(_Light)
*_Light = l;
if(maxval!=minval)
{
rnorm = (maxval - r)/mdiff;
gnorm = (maxval - g)/mdiff;
bnorm = (maxval - b)/mdiff;
}
else
{
if(_Saturation)
*_Saturation = 0;
if(_Hue)
*_Hue = 0;
return;
}
rnorm = gnorm = bnorm = 0;
mdiff = maxval - minval;
msum = maxval + minval;
float l = 0.5f * msum;
if(_Light)
*_Light = l;
if(maxval!=minval)
{
rnorm = (maxval - r)/mdiff;
gnorm = (maxval - g)/mdiff;
bnorm = (maxval - b)/mdiff;
}
else
{
if(_Saturation)
*_Saturation = 0;
if(_Hue)
*_Hue = 0;
return;
}
if(_Saturation)
{
if(l<0.5f)
*_Saturation = mdiff/msum;
else
*_Saturation = mdiff/(2.0f - msum);
}
if(_Saturation)
{
if(l<0.5f)
*_Saturation = mdiff/msum;
else
*_Saturation = mdiff/(2.0f - msum);
}
if(_Hue)
{
if(r==maxval)
*_Hue = 60.0f * (6.0f + bnorm - gnorm);
else if(g==maxval)
*_Hue = 60.0f * (2.0f + rnorm - bnorm);
else
*_Hue = 60.0f * (4.0f + gnorm - rnorm);
if(_Hue)
{
if(r==maxval)
*_Hue = 60.0f * (6.0f + bnorm - gnorm);
else if(g==maxval)
*_Hue = 60.0f * (2.0f + rnorm - bnorm);
else
*_Hue = 60.0f * (4.0f + gnorm - rnorm);
if(*_Hue>360.0f)
*_Hue -= 360.0f;
}
if(*_Hue>360.0f)
*_Hue -= 360.0f;
}
}
void ColorRGBToHLSi(int32 _R, int32 _G, int32 _B, int32 *_Hue, int32 *_Light, int32 *_Saturation)
void ColorRGBToHLSi(int _R, int _G, int _B, int *_Hue, int *_Light, int *_Saturation)
{
float32 h, l, s;
ColorRGBToHLSf((1.0f/255.0f)*float32(_R), (1.0f/255.0f)*float32(_G), (1.0f/255.0f)*float32(_B), &h, &l, &s);
if(_Hue) *_Hue = (int32)TClamp(h*(256.0f/360.0f), 0.0f, 255.0f);
if(_Light) *_Light = (int32)TClamp(l*256.0f, 0.0f, 255.0f);
if(_Saturation) *_Saturation= (int32)TClamp(s*256.0f, 0.0f, 255.0f);
float h, l, s;
ColorRGBToHLSf((1.0f/255.0f)*float(_R), (1.0f/255.0f)*float(_G), (1.0f/255.0f)*float(_B), &h, &l, &s);
if(_Hue) *_Hue = (int)TClamp(h*(256.0f/360.0f), 0.0f, 255.0f);
if(_Light) *_Light = (int)TClamp(l*256.0f, 0.0f, 255.0f);
if(_Saturation) *_Saturation= (int)TClamp(s*256.0f, 0.0f, 255.0f);
}
void ColorHLSToRGBf(float32 _Hue, float32 _Light, float32 _Saturation, float32 *_R, float32 *_G, float32 *_B)
void ColorHLSToRGBf(float _Hue, float _Light, float _Saturation, float *_R, float *_G, float *_B)
{
// Compute RGB from HLS. The light and saturation are between [0,1]
// and hue is between [0,360]. The returned r,g,b triplet is between [0,1].
// Compute RGB from HLS. The light and saturation are between [0,1]
// and hue is between [0,360]. The returned r,g,b triplet is between [0,1].
// a local auxiliary function
struct CLocal
{
static float32 HLSToRGB(float32 _Rn1, float32 _Rn2, float32 _Huei)
{
float32 hue = _Huei;
if(hue>360) hue = hue - 360;
if(hue<0) hue = hue + 360;
if(hue<60 ) return _Rn1 + (_Rn2-_Rn1)*hue/60;
if(hue<180) return _Rn2;
if(hue<240) return _Rn1 + (_Rn2-_Rn1)*(240-hue)/60;
return _Rn1;
}
};
// a local auxiliary function
struct CLocal
{
static float HLSToRGB(float _Rn1, float _Rn2, float _Huei)
{
float hue = _Huei;
if(hue>360) hue = hue - 360;
if(hue<0) hue = hue + 360;
if(hue<60 ) return _Rn1 + (_Rn2-_Rn1)*hue/60;
if(hue<180) return _Rn2;
if(hue<240) return _Rn1 + (_Rn2-_Rn1)*(240-hue)/60;
return _Rn1;
}
};
float32 rh, rl, rs, rm1, rm2;
rh = rl = rs = 0;
if(_Hue>0) rh = _Hue; if(rh>360) rh = 360;
if(_Light>0) rl = _Light; if(rl>1) rl = 1;
if(_Saturation>0) rs = _Saturation; if(rs>1) rs = 1;
float rh, rl, rs, rm1, rm2;
rh = rl = rs = 0;
if(_Hue>0) rh = _Hue; if(rh>360) rh = 360;
if(_Light>0) rl = _Light; if(rl>1) rl = 1;
if(_Saturation>0) rs = _Saturation; if(rs>1) rs = 1;
if(rl<=0.5f)
rm2 = rl*(1.0f + rs);
else
rm2 = rl + rs - rl*rs;
rm1 = 2.0f*rl - rm2;
if(rl<=0.5f)
rm2 = rl*(1.0f + rs);
else
rm2 = rl + rs - rl*rs;
rm1 = 2.0f*rl - rm2;
if(!rs)
{
if(_R) *_R = rl;
if(_G) *_G = rl;
if(_B) *_B = rl;
}
else
{
if(_R) *_R = CLocal::HLSToRGB(rm1, rm2, rh+120);
if(_G) *_G = CLocal::HLSToRGB(rm1, rm2, rh);
if(_B) *_B = CLocal::HLSToRGB(rm1, rm2, rh-120);
}
if(!rs)
{
if(_R) *_R = rl;
if(_G) *_G = rl;
if(_B) *_B = rl;
}
else
{
if(_R) *_R = CLocal::HLSToRGB(rm1, rm2, rh+120);
if(_G) *_G = CLocal::HLSToRGB(rm1, rm2, rh);
if(_B) *_B = CLocal::HLSToRGB(rm1, rm2, rh-120);
}
}
void ColorHLSToRGBi(int32 _Hue, int32 _Light, int32 _Saturation, int32 *_R, int32 *_G, int32 *_B)
void ColorHLSToRGBi(int _Hue, int _Light, int _Saturation, int *_R, int *_G, int *_B)
{
float32 r, g, b;
ColorHLSToRGBf((360.0f/255.0f)*float32(_Hue), (1.0f/255.0f)*float32(_Light), (1.0f/255.0f)*float32(_Saturation), &r, &g, &b);
if(_R) *_R = (int32)TClamp(r*256.0f, 0.0f, 255.0f);
if(_G) *_G = (int32)TClamp(g*256.0f, 0.0f, 255.0f);
if(_B) *_B = (int32)TClamp(b*256.0f, 0.0f, 255.0f);
float r, g, b;
ColorHLSToRGBf((360.0f/255.0f)*float(_Hue), (1.0f/255.0f)*float(_Light), (1.0f/255.0f)*float(_Saturation), &r, &g, &b);
if(_R) *_R = (int)TClamp(r*256.0f, 0.0f, 255.0f);
if(_G) *_G = (int)TClamp(g*256.0f, 0.0f, 255.0f);
if(_B) *_B = (int)TClamp(b*256.0f, 0.0f, 255.0f);
}
color32 ColorBlend(color32 _Color1, color32 _Color2, float32 _S)
color32 ColorBlend(color32 _Color1, color32 _Color2, float _S)
{
float32 a1, r1, g1, b1, a2, r2, g2, b2;
Color32ToARGBf(_Color1, &a1, &r1, &g1, &b1);
Color32ToARGBf(_Color2, &a2, &r2, &g2, &b2);
float32 t = 1.0f-_S;
return Color32FromARGBf(t*a1+_S*a2, t*r1+_S*r2, t*g1+_S*g2, t*b1+_S*b2);
float a1, r1, g1, b1, a2, r2, g2, b2;
Color32ToARGBf(_Color1, &a1, &r1, &g1, &b1);
Color32ToARGBf(_Color2, &a2, &r2, &g2, &b2);
float t = 1.0f-_S;
return Color32FromARGBf(t*a1+_S*a2, t*r1+_S*r2, t*g1+_S*g2, t*b1+_S*b2);
}

View File

@@ -1,67 +1,66 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwColors.h
// @brief Color conversions
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwColors.h
// @brief Color conversions
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// note: Private header
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_TW_COLORS_INCLUDED
#define ANT_TW_COLORS_INCLUDED
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
typedef unsigned int color32;
const color32 COLOR32_BLACK = 0xff000000; ///< Black color
const color32 COLOR32_WHITE = 0xffffffff; ///< White color
const color32 COLOR32_RED = 0xffff0000; ///< Red color
const color32 COLOR32_GREEN = 0xff00ff00; ///< Green color
const color32 COLOR32_BLUE = 0xff0000ff; ///< Blue color
const color32 COLOR32_BLACK = 0xff000000; // Black
const color32 COLOR32_WHITE = 0xffffffff; // White
const color32 COLOR32_ZERO = 0x00000000; // Zero
const color32 COLOR32_RED = 0xffff0000; // Red
const color32 COLOR32_GREEN = 0xff00ff00; // Green
const color32 COLOR32_BLUE = 0xff0000ff; // Blue
template <typename _T> inline const _T& TClamp(const _T& _X, const _T& _Limit1, const _T& _Limit2)
{
if( _Limit1<_Limit2 )
return (_X<=_Limit1) ? _Limit1 : ( (_X>=_Limit2) ? _Limit2 : _X );
else
return (_X<=_Limit2) ? _Limit2 : ( (_X>=_Limit1) ? _Limit1 : _X );
if( _Limit1<_Limit2 )
return (_X<=_Limit1) ? _Limit1 : ( (_X>=_Limit2) ? _Limit2 : _X );
else
return (_X<=_Limit2) ? _Limit2 : ( (_X>=_Limit1) ? _Limit1 : _X );
}
inline color32 Color32FromARGBi(int _A, int _R, int _G, int _B)
{
return (((color32)TClamp(_A, 0, 255))<<24) | (((color32)TClamp(_R, 0, 255))<<16) | (((color32)TClamp(_G, 0, 255))<<8) | ((color32)TClamp(_B, 0, 255));
return (((color32)TClamp(_A, 0, 255))<<24) | (((color32)TClamp(_R, 0, 255))<<16) | (((color32)TClamp(_G, 0, 255))<<8) | ((color32)TClamp(_B, 0, 255));
}
inline color32 Color32FromARGBf(float _A, float _R, float _G, float _B)
{
return (((color32)TClamp(_A*256.0f, 0.0f, 255.0f))<<24) | (((color32)TClamp(_R*256.0f, 0.0f, 255.0f))<<16) | (((color32)TClamp(_G*256.0f, 0.0f, 255.0f))<<8) | ((color32)TClamp(_B*256.0f, 0.0f, 255.0f));
return (((color32)TClamp(_A*256.0f, 0.0f, 255.0f))<<24) | (((color32)TClamp(_R*256.0f, 0.0f, 255.0f))<<16) | (((color32)TClamp(_G*256.0f, 0.0f, 255.0f))<<8) | ((color32)TClamp(_B*256.0f, 0.0f, 255.0f));
}
inline void Color32ToARGBi(color32 _Color, int *_A, int *_R, int *_G, int *_B)
{
if(_A) *_A = (_Color>>24)&0xff;
if(_R) *_R = (_Color>>16)&0xff;
if(_G) *_G = (_Color>>8)&0xff;
if(_B) *_B = _Color&0xff;
if(_A) *_A = (_Color>>24)&0xff;
if(_R) *_R = (_Color>>16)&0xff;
if(_G) *_G = (_Color>>8)&0xff;
if(_B) *_B = _Color&0xff;
}
inline void Color32ToARGBf(color32 _Color, float *_A, float *_R, float *_G, float *_B)
{
if(_A) *_A = (1.0f/255.0f)*float((_Color>>24)&0xff);
if(_R) *_R = (1.0f/255.0f)*float((_Color>>16)&0xff);
if(_G) *_G = (1.0f/255.0f)*float((_Color>>8)&0xff);
if(_B) *_B = (1.0f/255.0f)*float(_Color&0xff);
if(_A) *_A = (1.0f/255.0f)*float((_Color>>24)&0xff);
if(_R) *_R = (1.0f/255.0f)*float((_Color>>16)&0xff);
if(_G) *_G = (1.0f/255.0f)*float((_Color>>8)&0xff);
if(_B) *_B = (1.0f/255.0f)*float(_Color&0xff);
}
void ColorRGBToHLSf(float _R, float _G, float _B, float *_Hue, float *_Light, float *_Saturation);
@@ -75,7 +74,7 @@ void ColorHLSToRGBi(int _Hue, int _Light, int _Saturation, int *_R, int *_G, int
color32 ColorBlend(color32 _Color1, color32 _Color2, float _S);
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#endif // !defined ANT_TW_COLORS_INCLUDED

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,108 @@
// ---------------------------------------------------------------------------
//
// @file TwDirect3D10.h
// @brief Direct3D10 graph functions
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// note: Private header
//
// ---------------------------------------------------------------------------
#if !defined ANT_TW_DIRECT3D10_INCLUDED
#define ANT_TW_DIRECT3D10_INCLUDED
#include "TwGraph.h"
// ---------------------------------------------------------------------------
class CTwGraphDirect3D10 : public ITwGraph
{
public:
virtual int Init();
virtual int Shut();
virtual void BeginDraw(int _WndWidth, int _WndHeight);
virtual void EndDraw();
virtual bool IsDrawing();
virtual void Restore();
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false);
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) { DrawLine(_X0, _Y0, _X1, _Y1, _Color, _Color, _AntiAliased); }
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11);
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) { DrawRect(_X0, _Y0, _X1, _Y1, _Color, _Color, _Color, _Color); }
virtual void DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode);
virtual void * NewTextObj();
virtual void DeleteTextObj(void *_TextObj);
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth);
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor);
virtual void ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY);
virtual void RestoreViewport();
virtual void SetScissor(int _X0, int _Y0, int _Width, int _Height);
protected:
struct ID3D10Device * m_D3DDev;
unsigned int m_D3DDevInitialRefCount;
bool m_Drawing;
const CTexFont * m_FontTex;
struct ID3D10ShaderResourceView *m_FontD3DTexRV;
int m_WndWidth;
int m_WndHeight;
int m_OffsetX;
int m_OffsetY;
void * m_ViewportInit;
RECT m_ViewportAndScissorRects[2];
struct CLineRectVtx
{
float m_Pos[3];
color32 m_Color;
};
struct CTextVtx
{
float m_Pos[3];
color32 m_Color;
float m_UV[2];
};
struct CTextObj
{
struct ID3D10Buffer * m_TextVertexBuffer;
struct ID3D10Buffer * m_BgVertexBuffer;
int m_NbTextVerts;
int m_NbBgVerts;
int m_TextVertexBufferSize;
int m_BgVertexBufferSize;
bool m_LineColors;
bool m_LineBgColors;
};
struct CState10 * m_State;
struct ID3D10DepthStencilState *m_DepthStencilState;
struct ID3D10BlendState * m_BlendState;
struct ID3D10RasterizerState * m_RasterState;
struct ID3D10RasterizerState * m_RasterStateAntialiased;
struct ID3D10RasterizerState * m_RasterStateCullCW;
struct ID3D10RasterizerState * m_RasterStateCullCCW;
struct ID3D10Effect * m_Effect;
struct ID3D10EffectTechnique* m_LineRectTech;
struct ID3D10EffectTechnique* m_LineRectCstColorTech;
struct ID3D10InputLayout * m_LineRectVertexLayout;
struct ID3D10Buffer * m_LineVertexBuffer;
struct ID3D10Buffer * m_RectVertexBuffer;
struct ID3D10Buffer * m_TrianglesVertexBuffer;
int m_TrianglesVertexBufferCount;
struct ID3D10EffectTechnique* m_TextTech;
struct ID3D10EffectTechnique* m_TextCstColorTech;
struct ID3D10InputLayout * m_TextVertexLayout;
struct ID3D10EffectShaderResourceVariable *m_FontD3DResVar;
struct ID3D10EffectVectorVariable *m_OffsetVar;
struct ID3D10EffectVectorVariable *m_CstColorVar;
};
// ---------------------------------------------------------------------------
#endif // !defined ANT_TW_DIRECT3D10_INCLUDED

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,117 @@
// ---------------------------------------------------------------------------
//
// @file TwDirect3D11.h
// @brief Direct3D11 graphic functions
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// note: Private header
//
// ---------------------------------------------------------------------------
#if !defined ANT_TW_DIRECT3D11_INCLUDED
#define ANT_TW_DIRECT3D11_INCLUDED
#include "TwGraph.h"
// ---------------------------------------------------------------------------
class CTwGraphDirect3D11 : public ITwGraph
{
public:
virtual int Init();
virtual int Shut();
virtual void BeginDraw(int _WndWidth, int _WndHeight);
virtual void EndDraw();
virtual bool IsDrawing();
virtual void Restore();
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false);
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) { DrawLine(_X0, _Y0, _X1, _Y1, _Color, _Color, _AntiAliased); }
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11);
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) { DrawRect(_X0, _Y0, _X1, _Y1, _Color, _Color, _Color, _Color); }
virtual void DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode);
virtual void * NewTextObj();
virtual void DeleteTextObj(void *_TextObj);
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth);
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor);
virtual void ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY);
virtual void RestoreViewport();
virtual void SetScissor(int _X0, int _Y0, int _Width, int _Height);
protected:
struct ID3D11Device * m_D3DDev;
struct ID3D11DeviceContext *m_D3DDevImmContext;
unsigned int m_D3DDevInitialRefCount;
bool m_Drawing;
const CTexFont * m_FontTex;
struct ID3D11Texture2D * m_FontD3DTex;
struct ID3D11ShaderResourceView *m_FontD3DTexRV;
int m_WndWidth;
int m_WndHeight;
int m_OffsetX;
int m_OffsetY;
void * m_ViewportInit;
RECT m_ViewportAndScissorRects[2];
struct CLineRectVtx
{
float m_Pos[3];
color32 m_Color;
};
struct CTextVtx
{
float m_Pos[3];
color32 m_Color;
float m_UV[2];
};
struct CConstants
{
float m_Offset[4];
float m_CstColor[4];
};
struct CTextObj
{
struct ID3D11Buffer * m_TextVertexBuffer;
struct ID3D11Buffer * m_BgVertexBuffer;
int m_NbTextVerts;
int m_NbBgVerts;
int m_TextVertexBufferSize;
int m_BgVertexBufferSize;
bool m_LineColors;
bool m_LineBgColors;
};
struct CState11 * m_State;
struct ID3D11DepthStencilState *m_DepthStencilState;
struct ID3D11BlendState * m_BlendState;
struct ID3D11RasterizerState * m_RasterState;
struct ID3D11RasterizerState * m_RasterStateAntialiased;
struct ID3D11RasterizerState * m_RasterStateMultisample;
struct ID3D11RasterizerState * m_RasterStateCullCW;
struct ID3D11RasterizerState * m_RasterStateCullCCW;
struct ID3D11VertexShader * m_LineRectVS;
struct ID3D11VertexShader * m_LineRectCstColorVS;
struct ID3D11PixelShader * m_LineRectPS;
struct ID3D11InputLayout * m_LineRectVertexLayout;
struct ID3D11VertexShader * m_TextVS;
struct ID3D11VertexShader * m_TextCstColorVS;
struct ID3D11PixelShader * m_TextPS;
struct ID3D11InputLayout * m_TextVertexLayout;
struct ID3D11Buffer * m_LineVertexBuffer;
struct ID3D11Buffer * m_RectVertexBuffer;
struct ID3D11Buffer * m_TrianglesVertexBuffer;
int m_TrianglesVertexBufferCount;
struct ID3D11Buffer * m_ConstantBuffer;
struct ID3D11SamplerState * m_SamplerState;
};
// ---------------------------------------------------------------------------
#endif // !defined ANT_TW_DIRECT3D11_INCLUDED

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,14 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwDirect3D9.h
// @brief Direct3D9 graph functions
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwDirect3D9.h
// @brief Direct3D9 graph functions
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// note: Private header
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_TW_DIRECT3D9_INCLUDED
@@ -18,60 +16,75 @@
#include "TwGraph.h"
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
class CTwGraphDirect3D9 : public ITwGraph
{
public:
virtual int Init();
virtual int Shut();
virtual void BeginDraw(int _WndWidth, int _WndHeight);
virtual void EndDraw();
virtual bool IsDrawing();
virtual void Restore();
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false);
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) { DrawLine(_X0, _Y0, _X1, _Y1, _Color, _Color, _AntiAliased); }
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11);
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) { DrawRect(_X0, _Y0, _X1, _Y1, _Color, _Color, _Color, _Color); }
virtual int Init();
virtual int Shut();
virtual void BeginDraw(int _WndWidth, int _WndHeight);
virtual void EndDraw();
virtual bool IsDrawing();
virtual void Restore();
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false);
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) { DrawLine(_X0, _Y0, _X1, _Y1, _Color, _Color, _AntiAliased); }
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11);
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) { DrawRect(_X0, _Y0, _X1, _Y1, _Color, _Color, _Color, _Color); }
virtual void DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode);
virtual void * NewTextObj();
virtual void DeleteTextObj(void *_TextObj);
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth);
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor);
virtual void * NewTextObj();
virtual void DeleteTextObj(void *_TextObj);
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth);
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor);
virtual void ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY);
virtual void RestoreViewport();
virtual void SetScissor(int _X0, int _Y0, int _Width, int _Height);
protected:
struct IDirect3DDevice9 * m_D3DDev;
bool m_Drawing;
const CTexFont * m_FontTex;
struct IDirect3DTexture9 * m_FontD3DTex;
bool m_PureDevice;
int m_WndWidth;
int m_WndHeight;
struct IDirect3DDevice9 * m_D3DDev;
bool m_Drawing;
const CTexFont * m_FontTex;
struct IDirect3DTexture9 * m_FontD3DTex;
bool m_PureDevice;
int m_WndWidth;
int m_WndHeight;
void * m_ViewportInit;
int m_OffsetX;
int m_OffsetY;
struct CTextVtx
{
float m_Pos[4];
color32 m_Color;
float m_UV[2];
};
struct CBgVtx
{
float m_Pos[4];
color32 m_Color;
};
struct CTextVtx
{
float m_Pos[4];
color32 m_Color;
float m_UV[2];
};
struct CBgVtx
{
float m_Pos[4];
color32 m_Color;
};
struct CTextObj
{
std::vector<CTextVtx> m_TextVerts;
std::vector<CBgVtx> m_BgVerts;
bool m_LineColors;
bool m_LineBgColors;
};
struct CTextObj
{
std::vector<CTextVtx> m_TextVerts;
std::vector<CBgVtx> m_BgVerts;
bool m_LineColors;
bool m_LineBgColors;
};
struct CState * m_State;
struct CTriVtx
{
float m_Pos[4];
DWORD m_Color;
};
std::vector<CTriVtx> m_TriVertices;
struct CState * m_State;
};
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#endif // !defined ANT_TW_DIRECT3D9_INCLUDED

View File

@@ -1,37 +1,37 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwEventGLFW.c
// @brief Helper:
// translate and re-send mouse and keyboard events
// from GLFW event callbacks to AntTweakBar
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/10
// @file TwEventGLFW.c
// @brief Helper:
// translate and re-send mouse and keyboard events
// from GLFW event callbacks to AntTweakBar
//
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// note: TAB=4
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// #include <GL/glfw.h>
#include "MiniGLFW.h" // a subset of GLFW.h needed to compile TwEventGLFW.c
// note: AntTweakBar.dll does not need to link with GLFW,
// it just needs some definitions for its helper functions.
#include <AntTweakBar.h>
#include <GL/glfw.h>
int TW_CALL TwEventMouseButtonGLFW(int glfwButton, int glfwAction)
{
int handled = 0;
TwMouseAction action = (glfwAction==GLFW_PRESS) ? TW_MOUSE_PRESSED : TW_MOUSE_RELEASED;
int handled = 0;
TwMouseAction action = (glfwAction==GLFW_PRESS) ? TW_MOUSE_PRESSED : TW_MOUSE_RELEASED;
if( glfwButton==GLFW_MOUSE_BUTTON_LEFT )
handled = TwMouseButton(action, TW_MOUSE_LEFT);
else if( glfwButton==GLFW_MOUSE_BUTTON_RIGHT )
handled = TwMouseButton(action, TW_MOUSE_RIGHT);
else if( glfwButton==GLFW_MOUSE_BUTTON_MIDDLE )
handled = TwMouseButton(action, TW_MOUSE_MIDDLE);
if( glfwButton==GLFW_MOUSE_BUTTON_LEFT )
handled = TwMouseButton(action, TW_MOUSE_LEFT);
else if( glfwButton==GLFW_MOUSE_BUTTON_RIGHT )
handled = TwMouseButton(action, TW_MOUSE_RIGHT);
else if( glfwButton==GLFW_MOUSE_BUTTON_MIDDLE )
handled = TwMouseButton(action, TW_MOUSE_MIDDLE);
return handled;
return handled;
}
@@ -40,152 +40,173 @@ int g_KMod = 0;
int TW_CALL TwEventKeyGLFW(int glfwKey, int glfwAction)
{
int handled = 0;
int handled = 0;
// Register of modifiers state
if( glfwAction==GLFW_PRESS )
{
switch( glfwKey )
{
case GLFW_KEY_LSHIFT:
case GLFW_KEY_RSHIFT:
g_KMod |= TW_KMOD_SHIFT;
break;
case GLFW_KEY_LCTRL:
case GLFW_KEY_RCTRL:
g_KMod |= TW_KMOD_CTRL;
break;
case GLFW_KEY_LALT:
case GLFW_KEY_RALT:
g_KMod |= TW_KMOD_ALT;
break;
}
}
else
{
switch( glfwKey )
{
case GLFW_KEY_LSHIFT:
case GLFW_KEY_RSHIFT:
g_KMod &= ~TW_KMOD_SHIFT;
break;
case GLFW_KEY_LCTRL:
case GLFW_KEY_RCTRL:
g_KMod &= ~TW_KMOD_CTRL;
break;
case GLFW_KEY_LALT:
case GLFW_KEY_RALT:
g_KMod &= ~TW_KMOD_ALT;
break;
}
}
// Register of modifiers state
if( glfwAction==GLFW_PRESS )
{
switch( glfwKey )
{
case GLFW_KEY_LSHIFT:
case GLFW_KEY_RSHIFT:
g_KMod |= TW_KMOD_SHIFT;
break;
case GLFW_KEY_LCTRL:
case GLFW_KEY_RCTRL:
g_KMod |= TW_KMOD_CTRL;
break;
case GLFW_KEY_LALT:
case GLFW_KEY_RALT:
g_KMod |= TW_KMOD_ALT;
break;
}
}
else
{
switch( glfwKey )
{
case GLFW_KEY_LSHIFT:
case GLFW_KEY_RSHIFT:
g_KMod &= ~TW_KMOD_SHIFT;
break;
case GLFW_KEY_LCTRL:
case GLFW_KEY_RCTRL:
g_KMod &= ~TW_KMOD_CTRL;
break;
case GLFW_KEY_LALT:
case GLFW_KEY_RALT:
g_KMod &= ~TW_KMOD_ALT;
break;
}
}
// Process key pressed
if( glfwAction==GLFW_PRESS )
{
int mod = g_KMod;
int testkp = ((mod&TW_KMOD_CTRL) || (mod&TW_KMOD_ALT)) ? 1 : 0;
// Process key pressed
if( glfwAction==GLFW_PRESS )
{
int mod = g_KMod;
int testkp = ((mod&TW_KMOD_CTRL) || (mod&TW_KMOD_ALT)) ? 1 : 0;
if( (mod&TW_KMOD_CTRL) && glfwKey>0 && glfwKey<GLFW_KEY_SPECIAL ) // CTRL cases
handled = TwKeyPressed(glfwKey, mod);
else if( glfwKey>=GLFW_KEY_SPECIAL )
{
int k = 0;
if( (mod&TW_KMOD_CTRL) && glfwKey>0 && glfwKey<GLFW_KEY_SPECIAL ) // CTRL cases
handled = TwKeyPressed(glfwKey, mod);
else if( glfwKey>=GLFW_KEY_SPECIAL )
{
int k = 0;
if( glfwKey>=GLFW_KEY_F1 && glfwKey<=GLFW_KEY_F15 )
k = TW_KEY_F1 + (glfwKey-GLFW_KEY_F1);
else if( testkp && glfwKey>=GLFW_KEY_KP_0 && glfwKey<=GLFW_KEY_KP_9 )
k = '0' + (glfwKey-GLFW_KEY_KP_0);
else
{
switch( glfwKey )
{
case GLFW_KEY_ESC:
k = TW_KEY_ESCAPE;
break;
case GLFW_KEY_UP:
k = TW_KEY_UP;
break;
case GLFW_KEY_DOWN:
k = TW_KEY_DOWN;
break;
case GLFW_KEY_LEFT:
k = TW_KEY_LEFT;
break;
case GLFW_KEY_RIGHT:
k = TW_KEY_RIGHT;
break;
case GLFW_KEY_TAB:
k = TW_KEY_TAB;
break;
case GLFW_KEY_ENTER:
k = TW_KEY_RETURN;
break;
case GLFW_KEY_BACKSPACE:
k = TW_KEY_BACKSPACE;
break;
case GLFW_KEY_INSERT:
k = TW_KEY_INSERT;
break;
case GLFW_KEY_DEL:
k = TW_KEY_DELETE;
break;
case GLFW_KEY_PAGEUP:
k = TW_KEY_PAGE_UP;
break;
case GLFW_KEY_PAGEDOWN:
k = TW_KEY_PAGE_DOWN;
break;
case GLFW_KEY_HOME:
k = TW_KEY_HOME;
break;
case GLFW_KEY_END:
k = TW_KEY_END;
break;
case GLFW_KEY_KP_ENTER:
k = TW_KEY_RETURN;
break;
case GLFW_KEY_KP_DIVIDE:
if( testkp )
k = '/';
break;
case GLFW_KEY_KP_MULTIPLY:
if( testkp )
k = '*';
break;
case GLFW_KEY_KP_SUBTRACT:
if( testkp )
k = '-';
break;
case GLFW_KEY_KP_ADD:
if( testkp )
k = '+';
break;
case GLFW_KEY_KP_DECIMAL:
if( testkp )
k = '.';
break;
case GLFW_KEY_KP_EQUAL:
if( testkp )
k = '=';
break;
}
}
if( glfwKey>=GLFW_KEY_F1 && glfwKey<=GLFW_KEY_F15 )
k = TW_KEY_F1 + (glfwKey-GLFW_KEY_F1);
else if( testkp && glfwKey>=GLFW_KEY_KP_0 && glfwKey<=GLFW_KEY_KP_9 )
k = '0' + (glfwKey-GLFW_KEY_KP_0);
else
{
switch( glfwKey )
{
case GLFW_KEY_ESC:
k = TW_KEY_ESCAPE;
break;
case GLFW_KEY_UP:
k = TW_KEY_UP;
break;
case GLFW_KEY_DOWN:
k = TW_KEY_DOWN;
break;
case GLFW_KEY_LEFT:
k = TW_KEY_LEFT;
break;
case GLFW_KEY_RIGHT:
k = TW_KEY_RIGHT;
break;
case GLFW_KEY_TAB:
k = TW_KEY_TAB;
break;
case GLFW_KEY_ENTER:
k = TW_KEY_RETURN;
break;
case GLFW_KEY_BACKSPACE:
k = TW_KEY_BACKSPACE;
break;
case GLFW_KEY_INSERT:
k = TW_KEY_INSERT;
break;
case GLFW_KEY_DEL:
k = TW_KEY_DELETE;
break;
case GLFW_KEY_PAGEUP:
k = TW_KEY_PAGE_UP;
break;
case GLFW_KEY_PAGEDOWN:
k = TW_KEY_PAGE_DOWN;
break;
case GLFW_KEY_HOME:
k = TW_KEY_HOME;
break;
case GLFW_KEY_END:
k = TW_KEY_END;
break;
case GLFW_KEY_KP_ENTER:
k = TW_KEY_RETURN;
break;
case GLFW_KEY_KP_DIVIDE:
if( testkp )
k = '/';
break;
case GLFW_KEY_KP_MULTIPLY:
if( testkp )
k = '*';
break;
case GLFW_KEY_KP_SUBTRACT:
if( testkp )
k = '-';
break;
case GLFW_KEY_KP_ADD:
if( testkp )
k = '+';
break;
case GLFW_KEY_KP_DECIMAL:
if( testkp )
k = '.';
break;
case GLFW_KEY_KP_EQUAL:
if( testkp )
k = '=';
break;
}
}
if( k>0 )
handled = TwKeyPressed(k, mod);
}
}
if( k>0 )
handled = TwKeyPressed(k, mod);
}
}
return handled;
return handled;
}
int TW_CALL TwEventCharGLFW(int glfwChar, int glfwAction)
{
if( glfwAction==GLFW_PRESS && (glfwChar & 0xff00)==0 )
return TwKeyPressed(glfwChar, g_KMod);
else
return 0;
if( glfwAction==GLFW_PRESS && (glfwChar & 0xff00)==0 )
return TwKeyPressed(glfwChar, g_KMod);
return 0;
}
// functions with __cdecl calling convension
TW_API int TW_CDECL_CALL TwEventMouseButtonGLFWcdecl(int glfwButton, int glfwAction)
{
return TwEventMouseButtonGLFW(glfwButton, glfwAction);
}
TW_API int TW_CDECL_CALL TwEventKeyGLFWcdecl(int glfwKey, int glfwAction)
{
return TwEventKeyGLFW(glfwKey, glfwAction);
}
TW_API int TW_CDECL_CALL TwEventCharGLFWcdecl(int glfwChar, int glfwAction)
{
return TwEventCharGLFW(glfwChar, glfwAction);
}
TW_API int TW_CDECL_CALL TwEventMousePosGLFWcdecl(int mouseX, int mouseY)
{
return TwMouseMotion(mouseX, mouseY);
}
TW_API int TW_CDECL_CALL TwEventMouseWheelGLFWcdecl(int wheelPos)
{
return TwMouseWheel(wheelPos);
}

View File

@@ -1,148 +1,150 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwEventGLUT.c
// @brief Helper:
// translate and re-send mouse and keyboard events
// from GLUT event callbacks to AntTweakBar
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/10
// @file TwEventGLUT.c
// @brief Helper:
// translate and re-send mouse and keyboard events
// from GLUT event callbacks to AntTweakBar
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/10
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// note: TAB=4
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#define GLUT_NO_LIB_PRAGMA // we do not want to force linkage with glut
#define GLUT_NO_LIB_PRAGMA // we do not want to force linkage with glut
#ifdef _MSC_VER
# pragma warning(disable: 4505) // glut generates 'unreferenced function' warnings
# pragma warning(disable: 4100) // unreferenced parameter
# pragma warning(disable: 4505) // glut generates 'unreferenced function' warnings
# pragma warning(disable: 4100) // unreferenced parameter
#endif // _MSC_VER
#include <GL/glut.h>
// #include <GL/glut.h>
#include "MiniGLUT.h" // a subset of glut.h needed to compile TwEventGLUT.c
// note: AntTweakBar.dll does not need to link with GLUT,
// it just needs some definitions for its helper functions.
#include <AntTweakBar.h>
int TW_GLUT_CALL TwEventMouseButtonGLUT(int glutButton, int glutState, int mouseX, int mouseY)
int TW_GLUT_CALL TwEventMouseButtonGLUT(int glutButton, int glutState, int mouseX, int mouseY)
{
TwMouseAction action = (glutState==GLUT_DOWN) ? TW_MOUSE_PRESSED : TW_MOUSE_RELEASED;
TwMouseAction action = (glutState==GLUT_DOWN) ? TW_MOUSE_PRESSED : TW_MOUSE_RELEASED;
switch( glutButton )
{
case GLUT_LEFT_BUTTON:
return TwMouseButton(action, TW_MOUSE_LEFT);
case GLUT_RIGHT_BUTTON:
return TwMouseButton(action, TW_MOUSE_RIGHT);
case GLUT_MIDDLE_BUTTON:
return TwMouseButton(action, TW_MOUSE_MIDDLE);
default:
return 0;
}
TwMouseMotion(mouseX, mouseY);
switch( glutButton )
{
case GLUT_LEFT_BUTTON:
return TwMouseButton(action, TW_MOUSE_LEFT);
case GLUT_RIGHT_BUTTON:
return TwMouseButton(action, TW_MOUSE_RIGHT);
case GLUT_MIDDLE_BUTTON:
return TwMouseButton(action, TW_MOUSE_MIDDLE);
default:
return 0;
}
}
int TW_GLUT_CALL TwEventMouseMotionGLUT(int mouseX, int mouseY)
int TW_GLUT_CALL TwEventMouseMotionGLUT(int mouseX, int mouseY)
{
return TwMouseMotion(mouseX, mouseY);
return TwMouseMotion(mouseX, mouseY);
}
// GLUT does not send modifiers state to 'Key' and 'Special' callbacks,
// and we cannot call glutGetModifiers here because we do not want to link
// AntTweakBar with glut, so the following function is used to store
// a pointer to the glutGetModifiers function of the calling application.
// It must be called at initialisation of the application.
// GLUT does not send modifiers state to 'Key' and 'Special' callbacks,
// and we cannot call glutGetModifiers here because we do not want to link
// AntTweakBar with glut, so the following function is used to store
// a pointer to the glutGetModifiers function of the calling application.
// It must be called at initialisation of the application.
int (TW_CALL *g_GLUTGetModifiers)(void) = NULL;
int TW_CALL TwGLUTModifiersFunc(int (TW_CALL *glutGetModifiersFunc)(void))
int TW_CALL TwGLUTModifiersFunc(int (TW_CALL *glutGetModifiersFunc)(void))
{
g_GLUTGetModifiers = glutGetModifiersFunc;
return (g_GLUTGetModifiers==NULL) ? 0 : 1;
g_GLUTGetModifiers = glutGetModifiersFunc;
return (g_GLUTGetModifiers==NULL) ? 0 : 1;
}
int TW_GLUT_CALL TwEventKeyboardGLUT(unsigned char glutKey, int mouseX, int mouseY)
{
int kmod = 0;
int kmod = 0;
if( g_GLUTGetModifiers!=NULL )
{
int glutMod = g_GLUTGetModifiers();
if( g_GLUTGetModifiers!=NULL )
{
int glutMod = g_GLUTGetModifiers();
if( glutMod&GLUT_ACTIVE_SHIFT )
kmod |= TW_KMOD_SHIFT;
if( glutMod&GLUT_ACTIVE_CTRL )
kmod |= TW_KMOD_CTRL;
if( glutMod&GLUT_ACTIVE_ALT )
kmod |= TW_KMOD_ALT;
}
if( glutMod&GLUT_ACTIVE_SHIFT )
kmod |= TW_KMOD_SHIFT;
if( glutMod&GLUT_ACTIVE_CTRL )
kmod |= TW_KMOD_CTRL;
if( glutMod&GLUT_ACTIVE_ALT )
kmod |= TW_KMOD_ALT;
}
if( (kmod&TW_KMOD_CTRL) && (glutKey>0 && glutKey<27) ) // CTRL special case
glutKey += 'a'-1;
if( (kmod&TW_KMOD_CTRL) && (glutKey>0 && glutKey<27) ) // CTRL special case
glutKey += 'a'-1;
return TwKeyPressed((int)glutKey, kmod);
return TwKeyPressed((int)glutKey, kmod);
}
int TW_GLUT_CALL TwEventSpecialGLUT(int glutKey, int mouseX, int mouseY)
int TW_GLUT_CALL TwEventSpecialGLUT(int glutKey, int mouseX, int mouseY)
{
int k = 0, kmod = 0;
int k = 0, kmod = 0;
if( g_GLUTGetModifiers!=NULL )
{
int glutMod = g_GLUTGetModifiers();
if( g_GLUTGetModifiers!=NULL )
{
int glutMod = g_GLUTGetModifiers();
if( glutMod&GLUT_ACTIVE_SHIFT )
kmod |= TW_KMOD_SHIFT;
if( glutMod&GLUT_ACTIVE_CTRL )
kmod |= TW_KMOD_CTRL;
if( glutMod&GLUT_ACTIVE_ALT )
kmod |= TW_KMOD_ALT;
}
if( glutMod&GLUT_ACTIVE_SHIFT )
kmod |= TW_KMOD_SHIFT;
if( glutMod&GLUT_ACTIVE_CTRL )
kmod |= TW_KMOD_CTRL;
if( glutMod&GLUT_ACTIVE_ALT )
kmod |= TW_KMOD_ALT;
}
if( glutKey>=GLUT_KEY_F1 && glutKey<=GLUT_KEY_F12 )
k = TW_KEY_F1 + (glutKey-GLUT_KEY_F1);
else
{
switch( glutKey )
{
case GLUT_KEY_LEFT:
k = TW_KEY_LEFT;
break;
case GLUT_KEY_UP:
k = TW_KEY_UP;
break;
case GLUT_KEY_RIGHT:
k = TW_KEY_RIGHT;
break;
case GLUT_KEY_DOWN:
k = TW_KEY_DOWN;
break;
case GLUT_KEY_PAGE_UP:
k = TW_KEY_PAGE_UP;
break;
case GLUT_KEY_PAGE_DOWN:
k = TW_KEY_PAGE_DOWN;
break;
case GLUT_KEY_HOME:
k = TW_KEY_HOME;
break;
case GLUT_KEY_END:
k = TW_KEY_END;
break;
case GLUT_KEY_INSERT:
k = TW_KEY_INSERT;
break;
}
}
if( glutKey>=GLUT_KEY_F1 && glutKey<=GLUT_KEY_F12 )
k = TW_KEY_F1 + (glutKey-GLUT_KEY_F1);
else
{
switch( glutKey )
{
case GLUT_KEY_LEFT:
k = TW_KEY_LEFT;
break;
case GLUT_KEY_UP:
k = TW_KEY_UP;
break;
case GLUT_KEY_RIGHT:
k = TW_KEY_RIGHT;
break;
case GLUT_KEY_DOWN:
k = TW_KEY_DOWN;
break;
case GLUT_KEY_PAGE_UP:
k = TW_KEY_PAGE_UP;
break;
case GLUT_KEY_PAGE_DOWN:
k = TW_KEY_PAGE_DOWN;
break;
case GLUT_KEY_HOME:
k = TW_KEY_HOME;
break;
case GLUT_KEY_END:
k = TW_KEY_END;
break;
case GLUT_KEY_INSERT:
k = TW_KEY_INSERT;
break;
}
}
if( k>0 && k<TW_KEY_LAST )
return TwKeyPressed(k, kmod);
else
return 0;
if( k>0 && k<TW_KEY_LAST )
return TwKeyPressed(k, kmod);
else
return 0;
}

View File

@@ -1,70 +1,43 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwEventSLD.c
// @brief Helper:
// translate and re-send mouse and keyboard events
// from SDL event loop to AntTweakBar
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/10
// @file TwEventSDL.c
// @brief Helper:
// translate and re-send mouse and keyboard events
// from SDL event loop to AntTweakBar
//
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// note: TAB=4
// note: AntTweakBar.dll does not need to link with SDL,
// it just needs some definitions for its helper functions.
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#include <AntTweakBar.h>
#include <SDL/SDL.h>
int TW_CALL TwEventSDL12(const void *sdlEvent); // implemented in TwEventSDL12.c
int TW_CALL TwEventSDL13(const void *sdlEvent); // implmeneted in TwEventSDL13.c
#ifdef __cplusplus
extern "C" { int TW_CALL TwSetLastError(const char *staticErrorMessage); }
#else
int TW_CALL TwSetLastError(const char *staticErrorMessage);
#endif // __cplusplus
// TwEventSDL returns zero if msg has not been handled,
// and a non-zero value if it has been handled by the AntTweakBar library.
int TW_CALL TwEventSDL(const void *sdlEvent)
// TwEventSDL returns zero if msg has not been handled or the SDL version
// is not supported, and a non-zero value if it has been handled by the
// AntTweakBar library.
int TW_CALL TwEventSDL(const void *sdlEvent, unsigned char majorVersion, unsigned char minorVersion)
{
int handled = 0;
const SDL_Event *event = (const SDL_Event *)sdlEvent;
if( event==NULL )
return 0;
switch( event->type )
{
case SDL_KEYDOWN:
if ( event->key.keysym.unicode!=0 && (event->key.keysym.unicode & 0xFF00)==0 )
{
if( (event->key.keysym.unicode & 0xFF)<32 && (event->key.keysym.unicode & 0xFF)!=event->key.keysym.sym )
handled = TwKeyPressed((event->key.keysym.unicode & 0xFF)+'a'-1, event->key.keysym.mod);
else
handled = TwKeyPressed(event->key.keysym.unicode & 0xFF, event->key.keysym.mod);
}
else
handled = TwKeyPressed(event->key.keysym.sym, event->key.keysym.mod);
break;
case SDL_MOUSEMOTION:
handled = TwMouseMotion(event->motion.x, event->motion.y);
break;
case SDL_MOUSEBUTTONUP:
case SDL_MOUSEBUTTONDOWN:
if( event->type==SDL_MOUSEBUTTONDOWN && (event->button.button==4 || event->button.button==5) ) // mouse wheel
{
static int s_WheelPos = 0;
if( event->button.button==4 )
++s_WheelPos;
else
--s_WheelPos;
handled = TwMouseWheel(s_WheelPos);
}
else
handled = TwMouseButton((event->type==SDL_MOUSEBUTTONUP)?TW_MOUSE_RELEASED:TW_MOUSE_PRESSED, (TwMouseButtonID)event->button.button);
break;
case SDL_VIDEORESIZE:
// tell the new size to TweakBar
TwWindowSize(event->resize.w, event->resize.h);
// do not set 'handled', SDL_VIDEORESIZE may be also processed by the calling application
break;
}
return handled;
if (majorVersion < 1 || (majorVersion == 1 && minorVersion < 2))
{
static const char *g_ErrBadSDLVersion = "Unsupported SDL version";
TwSetLastError(g_ErrBadSDLVersion);
return 0;
}
else if (majorVersion == 1 && minorVersion == 2)
return TwEventSDL12(sdlEvent);
else // if( majorVersion==1 && minorVersion==3 )
return TwEventSDL13(sdlEvent); // will probably not work for version > 1.3, but give it a chance
}

View File

@@ -0,0 +1,256 @@
// ---------------------------------------------------------------------------
//
// @file TwEventWin.c
// @brief Helper:
// translate and re-send mouse and keyboard events
// from Windows message proc to AntTweakBar
//
// @author Philippe Decaudin - http://www.antisphere.com
// @date 2006/05/10
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// ---------------------------------------------------------------------------
#include <AntTweakBar.h>
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
// Mouse wheel support
#if !defined WM_MOUSEWHEEL
# define WM_MOUSEWHEEL 0x020A
#endif // WM_MOUSEWHEEL
#if !defined WHEEL_DELTA
#define WHEEL_DELTA 120
#endif // WHEEL_DELTA
#ifdef _WIN64
#define PARAM_INT __int64
#else
#define PARAM_INT int
#endif
// TwEventWin returns zero if msg has not been handled,
// and a non-zero value if it has been handled by the AntTweakBar library.
int TW_CALL TwEventWin(void *wnd, unsigned int msg, unsigned PARAM_INT _W64 wParam, PARAM_INT _W64 lParam)
{
int handled = 0;
static unsigned PARAM_INT s_PrevKeyDown = 0;
static PARAM_INT s_PrevKeyDownMod = 0;
static int s_PrevKeyDownHandled = 0;
switch( msg )
{
case WM_MOUSEMOVE:
// send signed! mouse coordinates
handled = TwMouseMotion((short)LOWORD(lParam), (short)HIWORD(lParam));
break;
case WM_LBUTTONDOWN:
case WM_LBUTTONDBLCLK:
SetCapture(wnd);
handled = TwMouseButton(TW_MOUSE_PRESSED, TW_MOUSE_LEFT);
break;
case WM_LBUTTONUP:
ReleaseCapture();
handled = TwMouseButton(TW_MOUSE_RELEASED, TW_MOUSE_LEFT);
break;
case WM_MBUTTONDOWN:
case WM_MBUTTONDBLCLK:
SetCapture(wnd);
handled = TwMouseButton(TW_MOUSE_PRESSED, TW_MOUSE_MIDDLE);
break;
case WM_MBUTTONUP:
ReleaseCapture();
handled = TwMouseButton(TW_MOUSE_RELEASED, TW_MOUSE_MIDDLE);
break;
case WM_RBUTTONDOWN:
case WM_RBUTTONDBLCLK:
SetCapture(wnd);
handled = TwMouseButton(TW_MOUSE_PRESSED, TW_MOUSE_RIGHT);
break;
case WM_RBUTTONUP:
ReleaseCapture();
handled = TwMouseButton(TW_MOUSE_RELEASED, TW_MOUSE_RIGHT);
break;
case WM_CHAR:
case WM_SYSCHAR:
{
int key = (int)(wParam&0xff);
int kmod = 0;
if( GetAsyncKeyState(VK_SHIFT)<0 )
kmod |= TW_KMOD_SHIFT;
if( GetAsyncKeyState(VK_CONTROL)<0 )
{
kmod |= TW_KMOD_CTRL;
if( key>0 && key<27 )
key += 'a'-1;
}
if( GetAsyncKeyState(VK_MENU)<0 )
kmod |= TW_KMOD_ALT;
if( key>0 && key<256 )
handled = TwKeyPressed(key, kmod);
}
break;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
{
int kmod = 0;
int testkp = 0;
int k = 0;
if( GetAsyncKeyState(VK_SHIFT)<0 )
kmod |= TW_KMOD_SHIFT;
if( GetAsyncKeyState(VK_CONTROL)<0 )
{
kmod |= TW_KMOD_CTRL;
testkp = 1;
}
if( GetAsyncKeyState(VK_MENU)<0 )
{
kmod |= TW_KMOD_ALT;
testkp = 1;
}
if( wParam>=VK_F1 && wParam<=VK_F15 )
k = TW_KEY_F1 + ((int)wParam-VK_F1);
else if( testkp && wParam>=VK_NUMPAD0 && wParam<=VK_NUMPAD9 )
k = '0' + ((int)wParam-VK_NUMPAD0);
else
{
switch( wParam )
{
case VK_UP:
k = TW_KEY_UP;
break;
case VK_DOWN:
k = TW_KEY_DOWN;
break;
case VK_LEFT:
k = TW_KEY_LEFT;
break;
case VK_RIGHT:
k = TW_KEY_RIGHT;
break;
case VK_INSERT:
k = TW_KEY_INSERT;
break;
case VK_DELETE:
k = TW_KEY_DELETE;
break;
case VK_PRIOR:
k = TW_KEY_PAGE_UP;
break;
case VK_NEXT:
k = TW_KEY_PAGE_DOWN;
break;
case VK_HOME:
k = TW_KEY_HOME;
break;
case VK_END:
k = TW_KEY_END;
break;
case VK_DIVIDE:
if( testkp )
k = '/';
break;
case VK_MULTIPLY:
if( testkp )
k = '*';
break;
case VK_SUBTRACT:
if( testkp )
k = '-';
break;
case VK_ADD:
if( testkp )
k = '+';
break;
case VK_DECIMAL:
if( testkp )
k = '.';
break;
default:
if( (kmod&TW_KMOD_CTRL) && (kmod&TW_KMOD_ALT) )
k = MapVirtualKey( (UINT)wParam, 2 ) & 0x0000FFFF;
}
}
if( k!=0 )
handled = TwKeyPressed(k, kmod);
else
{
// if the key will be handled at next WM_CHAR report this event as handled
int key = (int)(wParam&0xff);
if( kmod&TW_KMOD_CTRL && key>0 && key<27 )
key += 'a'-1;
if( key>0 && key<256 )
handled = TwKeyTest(key, kmod);
}
s_PrevKeyDown = wParam;
s_PrevKeyDownMod = kmod;
s_PrevKeyDownHandled = handled;
}
break;
case WM_KEYUP:
case WM_SYSKEYUP:
{
int kmod = 0;
if( GetAsyncKeyState(VK_SHIFT)<0 )
kmod |= TW_KMOD_SHIFT;
if( GetAsyncKeyState(VK_CONTROL)<0 )
kmod |= TW_KMOD_CTRL;
if( GetAsyncKeyState(VK_MENU)<0 )
kmod |= TW_KMOD_ALT;
// if the key has been handled at previous WM_KEYDOWN report this event as handled
if( s_PrevKeyDown==wParam && s_PrevKeyDownMod==kmod )
handled = s_PrevKeyDownHandled;
else
{
// if the key would have been handled report this event as handled
int key = (int)(wParam&0xff);
if( kmod&TW_KMOD_CTRL && key>0 && key<27 )
key += 'a'-1;
if( key>0 && key<256 )
handled = TwKeyTest(key, kmod);
}
// reset previous keydown
s_PrevKeyDown = 0;
s_PrevKeyDownMod = 0;
s_PrevKeyDownHandled = 0;
}
break;
case WM_MOUSEWHEEL:
{
static int s_WheelPos = 0;
s_WheelPos += ((short)HIWORD(wParam))/WHEEL_DELTA;
handled = TwMouseWheel(s_WheelPos);
}
break;
case WM_SIZE:
// tell the new size to AntTweakBar
TwWindowSize(LOWORD(lParam), HIWORD(lParam));
// do not set 'handled', WM_SIZE may be also processed by the calling application
break;
}
if( handled )
// Event has been handled by AntTweakBar, so we invalidate the window
// content to send a WM_PAINT which will redraw the tweak bar(s).
InvalidateRect(wnd, NULL, FALSE);
return handled;
}
// For compatibility with AntTweakBar versions prior to 1.11
#undef TwEventWin32
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
TW_EXPORT_API int TW_CALL TwEventWin32(void *wnd, unsigned int msg, unsigned int _W64 wParam, int _W64 lParam)
{
return TwEventWin(wnd, msg, wParam, lParam);
}
#ifdef __cplusplus
}
#endif // __cplusplus

View File

@@ -0,0 +1,205 @@
// ---------------------------------------------------------------------------
//
// @file TwEventX11.c
// @brief Helper:
// translate and forward mouse and keyboard events
// from X11 to AntTweakBar
//
// @contrib Greg Popovitch
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// ---------------------------------------------------------------------------
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/Xutil.h>
#include <AntTweakBar.h>
static int s_KMod = 0;
const int buff_sz = 80;
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
static int _XKeyRelease(XEvent *event)
{
KeySym keysym;
char buffer[buff_sz];
XLookupString((XKeyEvent *)event, buffer, buff_sz, &keysym, 0);
switch (keysym)
{
case XK_Control_L:
case XK_Control_R: s_KMod &= ~TW_KMOD_CTRL; break;
case XK_Shift_L:
case XK_Shift_R: s_KMod &= ~TW_KMOD_SHIFT; break;
case XK_Alt_L:
case XK_Alt_R: s_KMod &= ~TW_KMOD_ALT; break;
}
return 0;
}
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
static int _XKeyPress(XEvent *event)
{
int modifiers = 0; // modifiers sent to AntTweakBar
int k = 0; // key sent to AntTweakBar
KeySym keysym;
char buffer[buff_sz];
int num_char = XLookupString((XKeyEvent *)event, buffer, buff_sz, &keysym, 0);
if (event->xkey.state & ControlMask)
modifiers |= TW_KMOD_CTRL;
if (event->xkey.state & ShiftMask)
modifiers |= TW_KMOD_SHIFT;
if (event->xkey.state & Mod1Mask)
modifiers |= TW_KMOD_ALT;
switch (keysym)
{
case XK_Control_L:
case XK_Control_R: s_KMod |= TW_KMOD_CTRL; break;
case XK_Shift_L:
case XK_Shift_R: s_KMod |= TW_KMOD_SHIFT; break;
case XK_Alt_L:
case XK_Alt_R: s_KMod |= TW_KMOD_ALT; break;
case XK_Escape: k = TW_KEY_ESCAPE; break;
case XK_Help: k = TW_KEY_F1; break;
case XK_F1: k = TW_KEY_F1; break;
case XK_F2: k = TW_KEY_F2; break;
case XK_F3: k = TW_KEY_F3; break;
case XK_F4: k = TW_KEY_F4; break;
case XK_F5: k = TW_KEY_F5; break;
case XK_F6: k = TW_KEY_F6; break;
case XK_F7: k = TW_KEY_F7; break;
case XK_F8: k = TW_KEY_F8; break;
case XK_F9: k = TW_KEY_F9; break;
case XK_F10: k = TW_KEY_F10; break;
case XK_F11: k = TW_KEY_F11; break;
case XK_F12: k = TW_KEY_F12; break;
case XK_Up: k = TW_KEY_UP; break;
case XK_Down: k = TW_KEY_DOWN; break;
case XK_Right: k = TW_KEY_RIGHT; break;
case XK_Left: k = TW_KEY_LEFT; break;
case XK_Return: k = TW_KEY_RETURN; break;
case XK_Insert: k = TW_KEY_INSERT; break;
case XK_Delete: k = TW_KEY_DELETE; break;
case XK_BackSpace: k = TW_KEY_BACKSPACE; break;
case XK_Home: k = TW_KEY_HOME; break;
case XK_Tab: k = TW_KEY_TAB; break;
case XK_End: k = TW_KEY_END; break;
#ifdef XK_Enter
case XK_Enter: k = TW_KEY_RETURN; break;
#endif
#ifdef XK_KP_Home
case XK_KP_Home: k = TW_KEY_HOME; break;
case XK_KP_End: k = TW_KEY_END; break;
case XK_KP_Delete: k = TW_KEY_DELETE; break;
#endif
#ifdef XK_KP_Up
case XK_KP_Up: k = TW_KEY_UP; break;
case XK_KP_Down: k = TW_KEY_DOWN; break;
case XK_KP_Right: k = TW_KEY_RIGHT; break;
case XK_KP_Left: k = TW_KEY_LEFT; break;
#endif
#ifdef XK_KP_Page_Up
case XK_KP_Page_Up: k = TW_KEY_PAGE_UP; break;
case XK_KP_Page_Down: k = TW_KEY_PAGE_DOWN; break;
#endif
#ifdef XK_KP_Tab
case XK_KP_Tab: k = TW_KEY_TAB; break;
#endif
default:
if (0)
{
// should we do that, or rely on the buffer (see code below)
if (keysym > 12 && keysym < 127)
k = keysym;
}
break;
}
if (k == 0 && num_char)
{
int i, handled = 0;
for (i=0; i<num_char; ++i)
if (TwKeyPressed(buffer[i], modifiers))
handled = 1;
return handled;
}
// if we have a valid key, send to AntTweakBar
// -------------------------------------------
return (k > 0) ? TwKeyPressed(k, modifiers) : 0;
}
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
static int _XButtonEvent(XEvent *event)
{
TwMouseAction action = (event->type == ButtonPress) ? TW_MOUSE_PRESSED : TW_MOUSE_RELEASED;
XButtonEvent *xbe = (XButtonEvent *)event;
return TwMouseButton(action, xbe->button);
}
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
static int _XConfigureEvent(XEvent *event)
{
XConfigureEvent *xce = (XConfigureEvent *)event;
TwWindowSize(xce->width, xce->height);
return 0;
}
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
static int _XMotionEvent(XEvent *event)
{
XMotionEvent *xme = (XMotionEvent *)event;
return TwMouseMotion(xme->x, xme->y);
}
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
TW_API int TW_CDECL_CALL TwEventX11(void *xevent)
{
XEvent *event = (XEvent *)xevent;
switch (event->type)
{
case KeyPress:
return _XKeyPress(xevent);
case KeyRelease:
return 0; // _XKeyRelease(xevent);
case ButtonPress:
case ButtonRelease:
return _XButtonEvent(xevent);
case MotionNotify:
return _XMotionEvent(xevent);
case ConfigureNotify:
return _XConfigureEvent(xevent);
default:
break;
}
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,14 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwFonts.h
// @brief Bitmaps fonts
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwFonts.h
// @brief Bitmaps fonts
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// note: Private header
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_TW_FONTS_INCLUDED
@@ -37,19 +35,19 @@ Last row of a line of characters is a delimiter with color=zero at the last pixe
struct CTexFont
{
unsigned char * m_TexBytes;
int m_TexWidth; // power of 2
int m_TexHeight; // power of 2
float m_CharU0[256];
float m_CharV0[256];
float m_CharU1[256];
float m_CharV1[256];
int m_CharWidth[256];
int m_CharHeight;
int m_NbCharRead;
unsigned char * m_TexBytes;
int m_TexWidth; // power of 2
int m_TexHeight; // power of 2
float m_CharU0[256];
float m_CharV0[256];
float m_CharU1[256];
float m_CharV1[256];
int m_CharWidth[256];
int m_CharHeight;
int m_NbCharRead;
CTexFont();
~CTexFont();
CTexFont();
~CTexFont();
};
@@ -59,9 +57,10 @@ CTexFont *TwGenerateFont(const unsigned char *_Bitmap, int _BmWidth, int _BmHeig
extern CTexFont *g_DefaultSmallFont;
extern CTexFont *g_DefaultNormalFont;
extern CTexFont *g_DefaultLargeFont;
extern CTexFont *g_DefaultFixed1Font;
void TwGenerateDefaultFonts();
void TwDeleteDefaultFonts();
#endif // !defined ANT_TW_FONTS_INCLUDED
#endif // !defined ANT_TW_FONTS_INCLUDED

View File

@@ -1,16 +1,14 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwGraph.h
// @brief ITwGraph pure interface
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwGraph.h
// @brief ITwGraph pure interface
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// note: Private header
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_TW_GRAPH_INCLUDED
@@ -20,35 +18,41 @@
#include "TwFonts.h"
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#ifdef DrawText // DirectX redefines 'DrawText' !!
# undef DrawText
#endif // DrawText
#ifdef DrawText // DirectX redefines 'DrawText' !!
# undef DrawText
#endif // DrawText
class ITwGraph
{
public:
virtual int Init() = 0;
virtual int Shut() = 0;
virtual void BeginDraw(int _WndWidth, int _WndHeight) = 0;
virtual void EndDraw() = 0;
virtual bool IsDrawing() = 0;
virtual void Restore() = 0;
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false) = 0;
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) = 0;
virtual int Init() = 0;
virtual int Shut() = 0;
virtual void BeginDraw(int _WndWidth, int _WndHeight) = 0;
virtual void EndDraw() = 0;
virtual bool IsDrawing() = 0;
virtual void Restore() = 0;
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11) = 0;
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) = 0;
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false) = 0;
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) = 0;
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11) = 0;
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) = 0;
enum Cull { CULL_NONE, CULL_CW, CULL_CCW };
virtual void DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode) = 0;
virtual void * NewTextObj() = 0;
virtual void DeleteTextObj(void *_TextObj) = 0;
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth) = 0;
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor) = 0;
virtual void * NewTextObj() = 0;
virtual void DeleteTextObj(void *_TextObj) = 0;
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth) = 0;
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor) = 0;
virtual ~ITwGraph() {} // required by gcc
virtual void ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY) = 0;
virtual void RestoreViewport() = 0;
virtual void SetScissor(int _X0, int _Y0, int _Width, int _Height) = 0;
virtual ~ITwGraph() {} // required by gcc
};
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#endif // ANT_TW_GRAPH_INCLUDED
#endif // ANT_TW_GRAPH_INCLUDED

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,15 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwMgr.h
// @brief Tweak bar manager.
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwMgr.h
// @brief Tweak bar manager.
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// notes: Private header
// TAB=4
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_TW_MGR_INCLUDED
@@ -25,285 +24,495 @@
#include "AntPerfTimer.h"
//#define BENCH // uncomment to activate bench
//#define BENCH // uncomment to activate benchmarks
#ifdef BENCH
# define PERF(cmd) cmd
#else // BENCH
# define PERF(cmd)
#endif // BENCH
# define PERF(cmd) cmd
#else // BENCH
# define PERF(cmd)
#endif // BENCH
const int NB_ROTO_CURSORS = 12;
// ---------------------------------------------------------------------------
// API unexposed by AntTweakBar.h
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// API unexposed by AntTweakBar.h
// ---------------------------------------------------------------------------
// bar states -> use TwDefine instead
typedef enum ETwState
{
TW_STATE_SHOWN = 1,
TW_STATE_ICONIFIED = 2,
TW_STATE_HIDDEN = 3,
TW_STATE_ERROR = 0
TW_STATE_SHOWN = 1,
TW_STATE_ICONIFIED = 2,
TW_STATE_HIDDEN = 3,
TW_STATE_UNICONIFIED = 4,
TW_STATE_ERROR = 0
} TwState;
/*ANT_TWEAK_BAR_API*/ int ANT_CALL TwSetBarState(TwBar *bar, TwState state);
/*ANT_TWEAK_BAR_API*/ TwState ANT_CALL TwGetBarState(const TwBar *bar);
// var states -> use TwDefine instead: show/hide/iconify implemented only as string commands
//ANT_TWEAK_BAR_API int ANT_CALL TwSetVarState(TwBar *bar, const char *name, TwState state);
//ANT_TWEAK_BAR_API TwState ANT_CALL TwGetVarState(const TwBar *bar, const char *name);
/*ANT_TWEAK_BAR_API*/ int ANT_CALL TwSetBarState(TwBar *bar, TwState state);
/*ANT_TWEAK_BAR_API*/ //TwState ANT_CALL TwGetBarState(const TwBar *bar);
// var states -> use TwDefine instead: visible/iconified implemented only as string commands
//ANT_TWEAK_BAR_API int ANT_CALL TwSetVarState(TwBar *bar, const char *name, TwState state);
//ANT_TWEAK_BAR_API TwState ANT_CALL TwGetVarState(const TwBar *bar, const char *name);
struct CTwVarGroup;
typedef void (ANT_CALL *TwStructExtInitCallback)(void *structExtValue, void *clientData);
typedef void (ANT_CALL *TwCopyVarFromExtCallback)(void *structValue, const void *structExtValue, unsigned int structExtMemberIndex, void *clientData);
typedef void (ANT_CALL *TwCopyVarToExtCallback)(const void *structValue, void *structExtValue, unsigned int structExtMemberIndex, void *clientData);
/*ANT_TWEAK_BAR_API*/ TwType ANT_CALL TwDefineStructExt(const char *name, const TwStructMember *structExtMembers, unsigned int nbExtMembers, size_t structSize, size_t structExtSize, TwStructExtInitCallback structExtInitCallback, TwCopyVarFromExtCallback copyVarFromExtCallback, TwCopyVarToExtCallback copyVarToExtCallback, TwSummaryCallback summaryCallback, void *clientData);
/*ANT_TWEAK_BAR_API*/ TwType ANT_CALL TwDefineStructExt(const char *name, const TwStructMember *structExtMembers, unsigned int nbExtMembers, size_t structSize, size_t structExtSize, TwStructExtInitCallback structExtInitCallback, TwCopyVarFromExtCallback copyVarFromExtCallback, TwCopyVarToExtCallback copyVarToExtCallback, TwSummaryCallback summaryCallback, void *clientData, const char *help);
typedef void (ANT_CALL *TwCustomDrawCallback)(int w, int h, void *structExtValue, void *clientData, TwBar *bar, CTwVarGroup *varGrp);
typedef bool (ANT_CALL *TwCustomMouseMotionCallback)(int mouseX, int mouseY, int w, int h, void *structExtValue, void *clientData, TwBar *bar, CTwVarGroup *varGrp);
typedef bool (ANT_CALL *TwCustomMouseButtonCallback)(TwMouseButtonID button, bool pressed, int mouseX, int mouseY, int w, int h, void *structExtValue, void *clientData, TwBar *bar, CTwVarGroup *varGrp);
typedef void (ANT_CALL *TwCustomMouseLeaveCallback)(void *structExtValue, void *clientData, TwBar *bar);
enum ERetType
{
RET_ERROR = 0,
RET_DOUBLE,
RET_STRING
};
// ---------------------------------------------------------------------------
// AntTweakBar Manager
// ---------------------------------------------------------------------------
enum EButtonAlign
{
BUTTON_ALIGN_LEFT,
BUTTON_ALIGN_CENTER,
BUTTON_ALIGN_RIGHT
};
// ---------------------------------------------------------------------------
// AntTweakBar Manager
// ---------------------------------------------------------------------------
struct CTwMgr
{
ETwGraphAPI m_GraphAPI;
void * m_Device;
class ITwGraph * m_Graph;
int m_WndWidth;
int m_WndHeight;
const CTexFont * m_CurrentFont;
ETwGraphAPI m_GraphAPI;
void * m_Device;
int m_WndID;
class ITwGraph * m_Graph;
int m_WndWidth;
int m_WndHeight;
const CTexFont * m_CurrentFont;
std::vector<TwBar*> m_Bars;
std::vector<int> m_Order;
std::vector<TwBar*> m_Bars;
std::vector<int> m_Order;
std::vector<bool> m_MinOccupied;
void Minimize(TwBar *_Bar);
void Maximize(TwBar *_Bar);
void Hide(TwBar *_Bar);
void Unhide(TwBar *_Bar);
void SetFont(const CTexFont *_Font, bool _ResizeBars);
int m_LastMouseX;
int m_LastMouseY;
int m_LastMouseWheelPos;
std::vector<bool> m_MinOccupied;
void Minimize(TwBar *_Bar);
void Maximize(TwBar *_Bar);
void Hide(TwBar *_Bar);
void Unhide(TwBar *_Bar);
void SetFont(const CTexFont *_Font, bool _ResizeBars);
int m_LastMouseX;
int m_LastMouseY;
int m_LastMouseWheelPos;
int m_IconPos; // 0: bottom-left, 1:bottom-right, 2:top-left, 3:top-right
int m_IconAlign; // 0: vertical, 1: horizontal
int m_IconMarginX, m_IconMarginY;
bool m_FontResizable;
std::string m_BarAlwaysOnTop;
std::string m_BarAlwaysOnBottom;
bool m_UseOldColorScheme;
bool m_Contained;
EButtonAlign m_ButtonAlign;
bool m_OverlapContent;
bool m_Terminating;
std::string m_Help;
TwBar * m_HelpBar;
float m_LastHelpUpdateTime;
void UpdateHelpBar();
bool m_HelpBarNotUpToDate;
bool m_HelpBarUpdateNow;
void * m_KeyPressedTextObj;
bool m_KeyPressedBuildText;
std::string m_KeyPressedStr;
float m_KeyPressedTime;
void * m_InfoTextObj;
bool m_InfoBuildText;
int m_BarInitColorHue;
int FindBar(const char *_Name) const;
int HasAttrib(const char *_Attrib, bool *_HasValue) const;
int SetAttrib(int _AttribID, const char *_Value);
void SetLastError(const char *_StaticErrorMesssage); // _StaticErrorMesssage must be a static string
const char * GetLastError(); // returns a static string describing the error, and set LastError to NULL
const char * CheckLastError() const; // returns the LastError, but does not set it to NULL
void SetCurrentDbgParams(const char *file, int line);
TwBar * m_PopupBar;
CTwMgr(ETwGraphAPI _GraphAPI, void *_Device);
~CTwMgr();
std::string m_Help;
TwBar * m_HelpBar;
float m_LastHelpUpdateTime;
void UpdateHelpBar();
bool m_HelpBarNotUpToDate;
bool m_HelpBarUpdateNow;
void * m_KeyPressedTextObj;
bool m_KeyPressedBuildText;
std::string m_KeyPressedStr;
float m_KeyPressedTime;
void * m_InfoTextObj;
bool m_InfoBuildText;
int m_BarInitColorHue;
int FindBar(const char *_Name) const;
int HasAttrib(const char *_Attrib, bool *_HasValue) const;
int SetAttrib(int _AttribID, const char *_Value);
ERetType GetAttrib(int _AttribID, std::vector<double>& outDouble, std::ostringstream& outString) const;
void SetLastError(const char *_StaticErrorMesssage); // _StaticErrorMesssage must be a static string
const char * GetLastError(); // returns a static string describing the error, and set LastError to NULL
const char * CheckLastError() const; // returns the LastError, but does not set it to NULL
void SetCurrentDbgParams(const char *file, int line);
TwBar * m_PopupBar;
//bool IsProcessing() const { return m_Processing);
//void SetProcessing(bool processing) { m_Processing = processing; }
struct CStructMember
{
std::string m_Name;
std::string m_Label;
TwType m_Type;
size_t m_Offset;
std::string m_DefString;
size_t m_Size;
std::string m_Help;
};
struct CStruct
{
std::string m_Name;
std::vector<CStructMember> m_Members;
size_t m_Size;
TwSummaryCallback m_SummaryCallback;
void * m_SummaryClientData;
std::string m_Help;
bool m_IsExt;
size_t m_ClientStructSize;
TwStructExtInitCallback m_StructExtInitCallback;
TwCopyVarFromExtCallback m_CopyVarFromExtCallback;
TwCopyVarToExtCallback m_CopyVarToExtCallback;
void * m_ExtClientData;
CStruct() : m_IsExt(false), m_StructExtInitCallback(NULL), m_CopyVarFromExtCallback(NULL), m_CopyVarToExtCallback(NULL), m_ExtClientData(NULL) {}
static void ANT_CALL DefaultSummary(char *_SummaryString, size_t _SummaryMaxLength, const void *_Value, void *_ClientData);
static void * s_PassProxyAsClientData;
};
std::vector<CStruct> m_Structs;
CTwMgr(ETwGraphAPI _GraphAPI, void *_Device, int _WndID);
~CTwMgr();
// followings are used for TwAddVarCB( ... StructType ... )
struct CStructProxy
{
TwType m_Type;
void * m_StructData;
bool m_DeleteStructData;
void * m_StructExtData;
TwSetVarCallback m_StructSetCallback;
TwGetVarCallback m_StructGetCallback;
void * m_StructClientData;
CStructProxy();
~CStructProxy();
};
struct CMemberProxy
{
CStructProxy * m_StructProxy;
int m_MemberIndex;
struct CTwVar * m_Var;
struct CTwVarGroup * m_VarParent;
CTwBar * m_Bar;
CMemberProxy();
~CMemberProxy();
static void ANT_CALL SetCB(const void *_Value, void *_ClientData);
static void ANT_CALL GetCB(void *_Value, void *_ClientData);
};
std::list<CStructProxy> m_StructProxies; // elements should not move
std::list<CMemberProxy> m_MemberProxies; // elements should not move
struct CStructMember
{
std::string m_Name;
std::string m_Label;
TwType m_Type;
size_t m_Offset;
std::string m_DefString;
size_t m_Size;
std::string m_Help;
};
struct CStruct
{
std::string m_Name;
std::vector<CStructMember> m_Members;
size_t m_Size;
TwSummaryCallback m_SummaryCallback;
void * m_SummaryClientData;
std::string m_Help;
bool m_IsExt;
size_t m_ClientStructSize;
TwStructExtInitCallback m_StructExtInitCallback;
TwCopyVarFromExtCallback m_CopyVarFromExtCallback;
TwCopyVarToExtCallback m_CopyVarToExtCallback;
void * m_ExtClientData;
CStruct() : m_IsExt(false), m_StructExtInitCallback(NULL), m_CopyVarFromExtCallback(NULL), m_CopyVarToExtCallback(NULL), m_ExtClientData(NULL) {}
static void ANT_CALL DefaultSummary(char *_SummaryString, size_t _SummaryMaxLength, const void *_Value, void *_ClientData);
static void * s_PassProxyAsClientData;
};
std::vector<CStruct> m_Structs;
struct CEnum
{
std::string m_Name;
typedef std::map<unsigned int, std::string> CEntries;
CEntries m_Entries;
};
std::vector<CEnum> m_Enums;
// followings are used for TwAddVarCB( ... StructType ... )
struct CStructProxy
{
TwType m_Type;
void * m_StructData;
bool m_DeleteStructData;
void * m_StructExtData;
TwSetVarCallback m_StructSetCallback;
TwGetVarCallback m_StructGetCallback;
void * m_StructClientData;
TwCustomDrawCallback m_CustomDrawCallback;
TwCustomMouseMotionCallback m_CustomMouseMotionCallback;
TwCustomMouseButtonCallback m_CustomMouseButtonCallback;
TwCustomMouseLeaveCallback m_CustomMouseLeaveCallback;
bool m_CustomCaptureFocus;
int m_CustomIndexFirst;
int m_CustomIndexLast;
CStructProxy();
~CStructProxy();
};
struct CMemberProxy
{
CStructProxy * m_StructProxy;
int m_MemberIndex;
struct CTwVar * m_Var;
struct CTwVarGroup * m_VarParent;
CTwBar * m_Bar;
CMemberProxy();
~CMemberProxy();
static void ANT_CALL SetCB(const void *_Value, void *_ClientData);
static void ANT_CALL GetCB(void *_Value, void *_ClientData);
};
std::list<CStructProxy> m_StructProxies; // elements should not move
std::list<CMemberProxy> m_MemberProxies; // elements should not move
//void InitVarData(TwType _Type, void *_Data, size_t _Size);
//void UninitVarData(TwType _Type, void *_Data, size_t _Size);
TwType m_TypeColor32;
TwType m_TypeColor3F;
TwType m_TypeColor4F;
struct CEnum
{
std::string m_Name;
typedef std::map<unsigned int, std::string> CEntries;
CEntries m_Entries;
};
std::vector<CEnum> m_Enums;
PerfTimer m_Timer;
double m_LastMousePressedTime;
TwMouseButtonID m_LastMousePressedButtonID;
int m_LastMousePressedPosition[2];
double m_RepeatMousePressedDelay;
double m_RepeatMousePressedPeriod;
bool m_CanRepeatMousePressed;
bool m_IsRepeatingMousePressed;
TwType m_TypeColor32;
TwType m_TypeColor3F;
TwType m_TypeColor4F;
TwType m_TypeQuat4F;
TwType m_TypeQuat4D;
TwType m_TypeDir3F;
TwType m_TypeDir3D;
#if defined(ANT_WINDOWS)
typedef HCURSOR CCursor;
#elif defined(ANT_UNIX)
typedef Cursor CCursor;
CCursor PixmapCursor(int _CurIdx);
Display * m_CurrentXDisplay;
Window m_CurrentXWindow;
#endif // defined(ANT_UNIX)
bool m_CursorsCreated;
void CreateCursors();
void FreeCursors();
void SetCursor(CCursor _Cursor);
CCursor m_CursorArrow;
CCursor m_CursorMove;
CCursor m_CursorWE;
CCursor m_CursorNS;
CCursor m_CursorTopLeft;
CCursor m_CursorTopRight;
CCursor m_CursorBottomLeft;
CCursor m_CursorBottomRight;
CCursor m_CursorHelp;
CCursor m_CursorHand;
CCursor m_CursorCross;
CCursor m_CursorUpArrow;
CCursor m_CursorNo;
CCursor m_RotoCursors[NB_ROTO_CURSORS];
CCursor m_CursorCenter;
CCursor m_CursorPoint;
std::vector<char> m_CSStringBuffer;
struct CCDStdString
{
std::string * m_ClientStdStringPtr;
char m_LocalString[sizeof(std::string)+2*sizeof(void*)]; //+2*sizeof(void*) because of VC++ std::string extra info in Debug
TwSetVarCallback m_ClientSetCallback;
TwGetVarCallback m_ClientGetCallback;
void * m_ClientData;
static void ANT_CALL SetCB(const void *_Value, void *_ClientData);
static void ANT_CALL GetCB(void *_Value, void *_ClientData);
};
std::list<CCDStdString> m_CDStdStrings;
struct CClientStdString // Convertion between VC++ Debug/Release std::string
{
CClientStdString();
void FromLib(const char *libStr);
std::string& ToClient();
private:
char m_Data[sizeof(std::string)+2*sizeof(void *)];
std::string m_LibStr;
};
struct CLibStdString // Convertion between VC++ Debug/Release std::string
{
CLibStdString();
void FromClient(const std::string& clientStr);
std::string& ToLib();
private:
char m_Data[sizeof(std::string)+2*sizeof(void *)];
};
struct CCDStdStringRecord
{
void * m_DataPtr;
char m_PrevValue[sizeof(std::string)+2*sizeof(void*)];
CClientStdString m_ClientStdString;
};
std::vector<CCDStdStringRecord> m_CDStdStringRecords;
void UnrollCDStdString(std::vector<CCDStdStringRecord>& _Records, TwType _Type, void *_Data);
void RestoreCDStdString(const std::vector<CCDStdStringRecord>& _Records);
std::map<void *, std::vector<char> > m_CDStdStringCopyBuffers;
struct CCustom // custom var type
{
virtual ~CCustom() = 0;
};
std::vector<CCustom *> m_Customs;
PerfTimer m_Timer;
double m_LastMousePressedTime;
TwMouseButtonID m_LastMousePressedButtonID;
int m_LastMousePressedPosition[2];
double m_RepeatMousePressedDelay;
double m_RepeatMousePressedPeriod;
bool m_CanRepeatMousePressed;
bool m_IsRepeatingMousePressed;
double m_LastDrawTime;
#if defined(ANT_WINDOWS)
typedef HCURSOR CCursor;
CCursor PixmapCursor(int _CurIdx);
#elif defined(ANT_UNIX)
typedef Cursor CCursor;
CCursor PixmapCursor(int _CurIdx);
Display * m_CurrentXDisplay;
Window m_CurrentXWindow;
#elif defined(ANT_OSX)
typedef NSCursor * CCursor;
CCursor PixmapCursor(int _CurIdx);
#endif // defined(ANT_UNIX)
bool m_CursorsCreated;
void CreateCursors();
void FreeCursors();
void SetCursor(CCursor _Cursor);
CCursor m_CursorArrow;
CCursor m_CursorMove;
CCursor m_CursorWE;
CCursor m_CursorNS;
CCursor m_CursorTopLeft;
CCursor m_CursorTopRight;
CCursor m_CursorBottomLeft;
CCursor m_CursorBottomRight;
CCursor m_CursorHelp;
CCursor m_CursorHand;
CCursor m_CursorCross;
CCursor m_CursorUpArrow;
CCursor m_CursorNo;
CCursor m_CursorIBeam;
CCursor m_RotoCursors[NB_ROTO_CURSORS];
CCursor m_CursorCenter;
CCursor m_CursorPoint;
TwCopyCDStringToClient m_CopyCDStringToClient;
TwCopyStdStringToClient m_CopyStdStringToClient;
size_t m_ClientStdStringStructSize;
TwType m_ClientStdStringBaseType;
protected:
int m_NbMinimizedBars;
const char * m_LastError;
const char * m_CurrentDbgFile;
int m_CurrentDbgLine;
int m_NbMinimizedBars;
const char * m_LastError;
const char * m_CurrentDbgFile;
int m_CurrentDbgLine;
//bool m_Processing;
};
extern CTwMgr *g_TwMgr;
// ---------------------------------------------------------------------------
// Extra functions and twtypes
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Extra functions and TwTypes
// ---------------------------------------------------------------------------
bool TwGetKeyCode(int *_Code, int *_Modif, const char *_String);
bool TwGetKeyString(std::string *_String, int _Code, int _Modif);
const ETwType TW_TYPE_SHORTCUT = ETwType(0xfff1);
const ETwType TW_TYPE_HELP_GRP = ETwType(0xfff2);
const ETwType TW_TYPE_HELP_ATOM = ETwType(0xfff3);
const ETwType TW_TYPE_HELP_HEADER = ETwType(0xfff4);
const ETwType TW_TYPE_HELP_STRUCT = ETwType(0xfff5);
const ETwType TW_TYPE_BUTTON = ETwType(0xfff6);
const ETwType TW_TYPE_STRUCT_BASE = ETwType(0x10000000);
const ETwType TW_TYPE_ENUM_BASE = ETwType(0x20000000);
const TwType TW_TYPE_SHORTCUT = TwType(0xfff1);
const TwType TW_TYPE_HELP_GRP = TwType(0xfff2);
const TwType TW_TYPE_HELP_ATOM = TwType(0xfff3);
const TwType TW_TYPE_HELP_HEADER = TwType(0xfff4);
const TwType TW_TYPE_HELP_STRUCT = TwType(0xfff5);
const TwType TW_TYPE_BUTTON = TwType(0xfff6);
const TwType TW_TYPE_CDSTDSTRING = TwType(0xfff7);
const TwType TW_TYPE_STRUCT_BASE = TwType(0x10000000);
const TwType TW_TYPE_ENUM_BASE = TwType(0x20000000);
const TwType TW_TYPE_CSSTRING_BASE = TW_TYPE_CSSTRING(0); // defined as 0x30000000 (see AntTweakBar.h)
const TwType TW_TYPE_CSSTRING_MAX = TW_TYPE_CSSTRING(0xfffffff);
#define TW_CSSTRING_SIZE(type) ((int)((type)&0xfffffff))
const TwType TW_TYPE_CUSTOM_BASE = TwType(0x40000000);
const TwType TW_TYPE_STDSTRING_VS2008 = TwType(0x2fff0000);
const TwType TW_TYPE_STDSTRING_VS2010 = TwType(0x2ffe0000);
extern "C" int ANT_CALL TwSetLastError(const char *_StaticErrorMessage);
//const TwGraphAPI TW_OPENGL_CORE = (TwGraphAPI)5; // WIP (note: OpenGL Core Profil requires OpenGL 3.2 or later)
// Clipping helper
struct CRect
{
int X, Y, W, H;
CRect() : X(0), Y(0), W(0), H(0) {}
CRect(int _X, int _Y, int _W, int _H) : X(_X), Y(_Y), W(_W), H(_H) {}
bool operator==(const CRect& _Rect) { return (Empty() && _Rect.Empty()) || (X==_Rect.X && Y==_Rect.Y && W==_Rect.W && H==_Rect.H); }
bool Empty(int _Margin=0) const { return (W<=_Margin || H<=_Margin); }
bool Subtract(const CRect& _Rect, std::vector<CRect>& _OutRects) const;
bool Subtract(const std::vector<CRect>& _Rects, std::vector<CRect>& _OutRects) const;
};
// ---------------------------------------------------------------------------
// Color struct ext
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Global bar attribs
// ---------------------------------------------------------------------------
enum EMgrAttribs
{
MGR_HELP = 1,
MGR_FONT_SIZE,
MGR_FONT_STYLE,
MGR_ICON_POS,
MGR_ICON_ALIGN,
MGR_ICON_MARGIN,
MGR_FONT_RESIZABLE,
MGR_COLOR_SCHEME,
MGR_CONTAINED,
MGR_BUTTON_ALIGN,
MGR_OVERLAP
};
// ---------------------------------------------------------------------------
// Color struct ext
// ---------------------------------------------------------------------------
struct CColorExt
{
int R, G, B;
int H, L, S;
int A;
bool m_HLS, m_HasAlpha, m_OGL;
bool m_CanHaveAlpha;
bool m_IsColorF;
unsigned int m_PrevConvertedColor;
CTwMgr::CStructProxy*m_StructProxy;
void RGB2HLS();
void HLS2RGB();
static void ANT_CALL InitColor32CB(void *_ExtValue, void *_ClientData);
static void ANT_CALL InitColor3FCB(void *_ExtValue, void *_ClientData);
static void ANT_CALL InitColor4FCB(void *_ExtValue, void *_ClientData);
static void ANT_CALL CopyVarFromExtCB(void *_VarValue, const void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
static void ANT_CALL CopyVarToExtCB(const void *_VarValue, void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
static void ANT_CALL SummaryCB(char *_SummaryString, size_t _SummaryMaxLength, const void *_ExtValue, void *_ClientData);
static void CreateTypes();
int R, G, B;
int H, L, S;
int A;
bool m_HLS, m_HasAlpha, m_OGL;
bool m_CanHaveAlpha;
bool m_IsColorF;
unsigned int m_PrevConvertedColor;
CTwMgr::CStructProxy*m_StructProxy;
void RGB2HLS();
void HLS2RGB();
static void ANT_CALL InitColor32CB(void *_ExtValue, void *_ClientData);
static void ANT_CALL InitColor3FCB(void *_ExtValue, void *_ClientData);
static void ANT_CALL InitColor4FCB(void *_ExtValue, void *_ClientData);
static void ANT_CALL CopyVarFromExtCB(void *_VarValue, const void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
static void ANT_CALL CopyVarToExtCB(const void *_VarValue, void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
static void ANT_CALL SummaryCB(char *_SummaryString, size_t _SummaryMaxLength, const void *_ExtValue, void *_ClientData);
static void CreateTypes();
};
// ---------------------------------------------------------------------------
// CTwFPU objects set and restore the fpu precision if needed.
// (could be usefull because DirectX changes it and AntTweakBar requires default double precision)
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Quaternion struct ext
// ---------------------------------------------------------------------------
struct CQuaternionExt
{
double Qx, Qy, Qz, Qs; // Quat value
double Vx, Vy, Vz, Angle; // Not used
double Dx, Dy, Dz; // Dir value set when used as a direction
bool m_AAMode; // Axis & angle mode -> disabled
bool m_ShowVal; // Display values
bool m_IsFloat; // Quat/Dir uses floats
bool m_IsDir; // Mapped to a dir vector instead of a quat
double m_Dir[3]; // If not zero, display one direction vector
color32 m_DirColor; // Direction vector color
float m_Permute[3][3]; // Permute frame axis
CTwMgr::CStructProxy*m_StructProxy;
static void ANT_CALL InitQuat4FCB(void *_ExtValue, void *_ClientData);
static void ANT_CALL InitQuat4DCB(void *_ExtValue, void *_ClientData);
static void ANT_CALL InitDir3FCB(void *_ExtValue, void *_ClientData);
static void ANT_CALL InitDir3DCB(void *_ExtValue, void *_ClientData);
static void ANT_CALL CopyVarFromExtCB(void *_VarValue, const void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
static void ANT_CALL CopyVarToExtCB(const void *_VarValue, void *_ExtValue, unsigned int _ExtMemberIndex, void *_ClientData);
static void ANT_CALL SummaryCB(char *_SummaryString, size_t _SummaryMaxLength, const void *_ExtValue, void *_ClientData);
static void ANT_CALL DrawCB(int _W, int _H, void *_ExtValue, void *_ClientData, TwBar *_Bar, CTwVarGroup *varGrp);
static bool ANT_CALL MouseMotionCB(int _MouseX, int _MouseY, int _W, int _H, void *_StructExtValue, void *_ClientData, TwBar *_Bar, CTwVarGroup *varGrp);
static bool ANT_CALL MouseButtonCB(TwMouseButtonID _Button, bool _Pressed, int _MouseX, int _MouseY, int _W, int _H, void *_StructExtValue, void *_ClientData, TwBar *_Bar, CTwVarGroup *varGrp);
static void ANT_CALL MouseLeaveCB(void *_StructExtValue, void *_ClientData, TwBar *_Bar);
static void CreateTypes();
static TwType s_CustomType;
void ConvertToAxisAngle();
void ConvertFromAxisAngle();
void CopyToVar();
static std::vector<float> s_SphTri;
static std::vector<color32> s_SphCol;
static std::vector<int> s_SphTriProj;
static std::vector<color32> s_SphColLight;
static std::vector<float> s_ArrowTri[4];
static std::vector<int> s_ArrowTriProj[4];
static std::vector<float> s_ArrowNorm[4];
static std::vector<color32> s_ArrowColLight[4];
enum EArrowParts { ARROW_CONE, ARROW_CONE_CAP, ARROW_CYL, ARROW_CYL_CAP };
static void CreateSphere();
static void CreateArrow();
static void ApplyQuat(float *outX, float *outY, float *outZ, float x, float y, float z, float qx, float qy, float qz, float qs);
static void QuatFromDir(double *outQx, double *outQy, double *outQz, double *outQs, double dx, double dy, double dz);
inline void Permute(float *outX, float *outY, float *outZ, float x, float y, float z);
inline void PermuteInv(float *outX, float *outY, float *outZ, float x, float y, float z);
inline void Permute(double *outX, double *outY, double *outZ, double x, double y, double z);
inline void PermuteInv(double *outX, double *outY, double *outZ, double x, double y, double z);
bool m_Highlighted;
bool m_Rotating;
double m_OrigQuat[4];
float m_OrigX, m_OrigY;
double m_PrevX, m_PrevY;
};
// ---------------------------------------------------------------------------
// CTwFPU objects set and restore the fpu precision if needed.
// (could be useful because DirectX changes it and AntTweakBar requires default double precision)
// ---------------------------------------------------------------------------
struct CTwFPU
{
CTwFPU()
{
#ifdef ANT_WINDOWS
state0 = _controlfp(0, 0);
if( (state0&MCW_PC)==_PC_24 ) // we need at least _PC_53
_controlfp(_PC_53, MCW_PC);
#else
state0 = 0;
#endif
}
~CTwFPU()
{
#ifdef ANT_WINDOWS
if( (state0&MCW_PC)==_PC_24 )
_controlfp(_PC_24, MCW_PC);
#else
state0 = 0;
#endif
}
CTwFPU()
{
#ifdef ANT_WINDOWS
state0 = _controlfp(0, 0);
if( (state0&MCW_PC)==_PC_24 ) // we need at least _PC_53
_controlfp(_PC_53, MCW_PC);
#else
state0 = 0;
#endif
}
~CTwFPU()
{
#ifdef ANT_WINDOWS
if( (state0&MCW_PC)==_PC_24 )
_controlfp(_PC_24, MCW_PC);
#else
state0 = 0;
#endif
}
private:
unsigned int state0;
unsigned int state0;
};
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#endif // !defined ANT_TW_MGR_INCLUDED

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,15 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwOpenGL.h
// @brief OpenGL graph functions
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwOpenGL.h
// @brief OpenGL graph functions
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// notes: Private header
// TAB=4
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_TW_OPENGL_INCLUDED
@@ -18,55 +17,83 @@
#include "TwGraph.h"
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
class CTwGraphOpenGL : public ITwGraph
{
public:
virtual int Init();
virtual int Shut();
virtual void BeginDraw(int _WndWidth, int _WndHeight);
virtual void EndDraw();
virtual bool IsDrawing();
virtual void Restore();
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false);
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) { DrawLine(_X0, _Y0, _X1, _Y1, _Color, _Color, _AntiAliased); }
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11);
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) { DrawRect(_X0, _Y0, _X1, _Y1, _Color, _Color, _Color, _Color); }
virtual int Init();
virtual int Shut();
virtual void BeginDraw(int _WndWidth, int _WndHeight);
virtual void EndDraw();
virtual bool IsDrawing();
virtual void Restore();
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false);
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) { DrawLine(_X0, _Y0, _X1, _Y1, _Color, _Color, _AntiAliased); }
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11);
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) { DrawRect(_X0, _Y0, _X1, _Y1, _Color, _Color, _Color, _Color); }
virtual void DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode);
virtual void * NewTextObj();
virtual void DeleteTextObj(void *_TextObj);
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth);
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor);
virtual void * NewTextObj();
virtual void DeleteTextObj(void *_TextObj);
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth);
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor);
virtual void ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY);
virtual void RestoreViewport();
virtual void SetScissor(int _X0, int _Y0, int _Width, int _Height);
protected:
bool m_Drawing;
GLuint m_FontTexID;
const CTexFont * m_FontTex;
GLfloat m_PrevLineWidth;
GLint m_PrevTexEnv;
GLint m_PrevPolygonMode[2];
GLint m_MaxClipPlanes;
GLint m_PrevTexture;
GLint m_PrevArrayBufferARB;
GLint m_PrevElementArrayBufferARB;
GLboolean m_PrevVertexProgramARB;
GLboolean m_PrevFragmentProgramARB;
GLuint m_PrevProgramObjectARB;
bool m_Drawing;
GLuint m_FontTexID;
const CTexFont * m_FontTex;
GLfloat m_PrevLineWidth;
GLint m_PrevTexEnv;
GLint m_PrevPolygonMode[2];
GLint m_MaxClipPlanes;
GLint m_PrevTexture;
GLint m_PrevArrayBufferARB;
GLint m_PrevElementArrayBufferARB;
GLboolean m_PrevVertexProgramARB;
GLboolean m_PrevFragmentProgramARB;
GLuint m_PrevProgramObjectARB;
GLboolean m_PrevTexture3D;
enum EMaxTextures { MAX_TEXTURES = 128 };
GLboolean m_PrevActiveTexture1D[MAX_TEXTURES];
GLboolean m_PrevActiveTexture2D[MAX_TEXTURES];
GLboolean m_PrevActiveTexture3D[MAX_TEXTURES];
GLboolean m_PrevClientTexCoordArray[MAX_TEXTURES];
GLint m_PrevActiveTextureARB;
GLint m_PrevClientActiveTextureARB;
bool m_SupportTexRect;
GLboolean m_PrevTexRectARB;
GLint m_PrevBlendEquation;
GLint m_PrevBlendEquationRGB;
GLint m_PrevBlendEquationAlpha;
GLint m_PrevBlendSrcRGB;
GLint m_PrevBlendDstRGB;
GLint m_PrevBlendSrcAlpha;
GLint m_PrevBlendDstAlpha;
GLuint m_PrevVertexArray;
GLint m_ViewportInit[4];
GLfloat m_ProjMatrixInit[16];
enum EMaxVtxAttribs { MAX_VERTEX_ATTRIBS = 128 };
GLint m_PrevEnabledVertexAttrib[MAX_VERTEX_ATTRIBS];
int m_WndWidth;
int m_WndHeight;
struct Vec2 { GLfloat x, y; Vec2(){} Vec2(GLfloat _X, GLfloat _Y):x(_X),y(_Y){} Vec2(int _X, int _Y):x(GLfloat(_X)),y(GLfloat(_Y)){} };
struct CTextObj
{
std::vector<Vec2> m_TextVerts;
std::vector<Vec2> m_TextUVs;
std::vector<Vec2> m_BgVerts;
std::vector<color32>m_Colors;
std::vector<color32>m_BgColors;
};
struct Vec2 { GLfloat x, y; Vec2(){} Vec2(GLfloat _X, GLfloat _Y):x(_X),y(_Y){} Vec2(int _X, int _Y):x(GLfloat(_X)),y(GLfloat(_Y)){} };
struct CTextObj
{
std::vector<Vec2> m_TextVerts;
std::vector<Vec2> m_TextUVs;
std::vector<Vec2> m_BgVerts;
std::vector<color32>m_Colors;
std::vector<color32>m_BgColors;
};
};
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#endif // !defined ANT_TW_OPENGL_INCLUDED

View File

@@ -0,0 +1,927 @@
// ---------------------------------------------------------------------------
//
// @file TwOpenGLCore.cpp
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// ---------------------------------------------------------------------------
/*
#pragma warning GL3 //// used for development
#define GL3_PROTOTYPES 1 ////
#include <GL3/gl3.h> ////
#define ANT_OGL_HEADER_INCLUDED ////
*/
#if defined ANT_OSX
# include <OpenGL/gl3.h>
# define ANT_OGL_HEADER_INCLUDED
#endif
#include "TwPrecomp.h"
#include "LoadOGLCore.h"
#include "TwOpenGLCore.h"
#include "TwMgr.h"
using namespace std;
extern const char *g_ErrCantLoadOGL;
extern const char *g_ErrCantUnloadOGL;
// ---------------------------------------------------------------------------
#ifdef _DEBUG
static void CheckGLCoreError(const char *file, int line, const char *func)
{
int err=0;
char msg[256];
while( (err=_glGetError())!=0 )
{
sprintf(msg, "%s(%d) : [%s] GL_CORE_ERROR=0x%x\n", file, line, func, err);
#ifdef ANT_WINDOWS
OutputDebugString(msg);
#endif
fprintf(stderr, msg);
}
}
# ifdef __FUNCTION__
# define CHECK_GL_ERROR CheckGLCoreError(__FILE__, __LINE__, __FUNCTION__)
# else
# define CHECK_GL_ERROR CheckGLCoreError(__FILE__, __LINE__, "")
# endif
#else
# define CHECK_GL_ERROR ((void)(0))
#endif
// ---------------------------------------------------------------------------
static GLuint BindFont(const CTexFont *_Font)
{
GLuint TexID = 0;
_glGenTextures(1, &TexID);
_glBindTexture(GL_TEXTURE_2D, TexID);
_glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
_glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
_glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, _Font->m_TexWidth, _Font->m_TexHeight, 0, GL_RED, GL_UNSIGNED_BYTE, _Font->m_TexBytes);
_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_NEAREST);
_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST);
_glBindTexture(GL_TEXTURE_2D, 0);
return TexID;
}
static void UnbindFont(GLuint _FontTexID)
{
if( _FontTexID>0 )
_glDeleteTextures(1, &_FontTexID);
}
// ---------------------------------------------------------------------------
static GLuint CompileShader(GLuint shader)
{
_glCompileShader(shader); CHECK_GL_ERROR;
GLint status;
_glGetShaderiv(shader, GL_COMPILE_STATUS, &status); CHECK_GL_ERROR;
if (status == GL_FALSE)
{
GLint infoLogLength;
_glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLogLength); CHECK_GL_ERROR;
GLchar strInfoLog[256];
_glGetShaderInfoLog(shader, sizeof(strInfoLog), NULL, strInfoLog); CHECK_GL_ERROR;
#ifdef ANT_WINDOWS
OutputDebugString("Compile failure: ");
OutputDebugString(strInfoLog);
OutputDebugString("\n");
#endif
fprintf(stderr, "Compile failure: %s\n", strInfoLog);
shader = 0;
}
return shader;
}
static GLuint LinkProgram(GLuint program)
{
_glLinkProgram(program); CHECK_GL_ERROR;
GLint status;
_glGetProgramiv(program, GL_LINK_STATUS, &status); CHECK_GL_ERROR;
if (status == GL_FALSE)
{
GLint infoLogLength;
_glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLogLength); CHECK_GL_ERROR;
GLchar strInfoLog[256];
_glGetProgramInfoLog(program, sizeof(strInfoLog), NULL, strInfoLog); CHECK_GL_ERROR;
#ifdef ANT_WINDOWS
OutputDebugString("Linker failure: ");
OutputDebugString(strInfoLog);
OutputDebugString("\n");
#endif
fprintf(stderr, "Linker failure: %s\n", strInfoLog);
program = 0;
}
return program;
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::ResizeTriBuffers(size_t _NewSize)
{
m_TriBufferSize = _NewSize;
_glBindVertexArray(m_TriVArray);
_glBindBuffer(GL_ARRAY_BUFFER, m_TriVertices);
_glBufferData(GL_ARRAY_BUFFER, m_TriBufferSize*sizeof(Vec2), 0, GL_DYNAMIC_DRAW);
_glBindBuffer(GL_ARRAY_BUFFER, m_TriUVs);
_glBufferData(GL_ARRAY_BUFFER, m_TriBufferSize*sizeof(Vec2), 0, GL_DYNAMIC_DRAW);
_glBindBuffer(GL_ARRAY_BUFFER, m_TriColors);
_glBufferData(GL_ARRAY_BUFFER, m_TriBufferSize*sizeof(color32), 0, GL_DYNAMIC_DRAW);
CHECK_GL_ERROR;
}
// ---------------------------------------------------------------------------
int CTwGraphOpenGLCore::Init()
{
m_Drawing = false;
m_FontTexID = 0;
m_FontTex = NULL;
if( LoadOpenGLCore()==0 )
{
g_TwMgr->SetLastError(g_ErrCantLoadOGL);
return 0;
}
// Create line/rect shaders
const GLchar *lineRectVS[] = {
"#version 150 core\n"
"in vec3 vertex;"
"in vec4 color;"
"out vec4 fcolor;"
"void main() { gl_Position = vec4(vertex, 1); fcolor = color; }"
};
m_LineRectVS = _glCreateShader(GL_VERTEX_SHADER);
_glShaderSource(m_LineRectVS, 1, lineRectVS, NULL);
CompileShader(m_LineRectVS);
const GLchar *lineRectFS[] = {
"#version 150 core\n"
"precision highp float;"
"in vec4 fcolor;"
"out vec4 outColor;"
"void main() { outColor = fcolor; }"
};
m_LineRectFS = _glCreateShader(GL_FRAGMENT_SHADER);
_glShaderSource(m_LineRectFS, 1, lineRectFS, NULL);
CompileShader(m_LineRectFS);
m_LineRectProgram = _glCreateProgram();
_glAttachShader(m_LineRectProgram, m_LineRectVS);
_glAttachShader(m_LineRectProgram, m_LineRectFS);
_glBindAttribLocation(m_LineRectProgram, 0, "vertex");
_glBindAttribLocation(m_LineRectProgram, 1, "color");
LinkProgram(m_LineRectProgram);
// Create line/rect vertex buffer
const GLfloat lineRectInitVertices[] = { 0,0,0, 0,0,0, 0,0,0, 0,0,0 };
const color32 lineRectInitColors[] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff };
_glGenVertexArrays(1, &m_LineRectVArray);
_glBindVertexArray(m_LineRectVArray);
_glGenBuffers(1, &m_LineRectVertices);
_glBindBuffer(GL_ARRAY_BUFFER, m_LineRectVertices);
_glBufferData(GL_ARRAY_BUFFER, sizeof(lineRectInitVertices), lineRectInitVertices, GL_DYNAMIC_DRAW);
_glGenBuffers(1, &m_LineRectColors);
_glBindBuffer(GL_ARRAY_BUFFER, m_LineRectColors);
_glBufferData(GL_ARRAY_BUFFER, sizeof(lineRectInitColors), lineRectInitColors, GL_DYNAMIC_DRAW);
// Create triangles shaders
const GLchar *triVS[] = {
"#version 150 core\n"
"uniform vec2 offset;"
"uniform vec2 wndSize;"
"in vec2 vertex;"
"in vec4 color;"
"out vec4 fcolor;"
"void main() { gl_Position = vec4(2.0*(vertex.x+offset.x-0.5)/wndSize.x - 1.0, 1.0 - 2.0*(vertex.y+offset.y-0.5)/wndSize.y, 0, 1); fcolor = color; }"
};
m_TriVS = _glCreateShader(GL_VERTEX_SHADER);
_glShaderSource(m_TriVS, 1, triVS, NULL);
CompileShader(m_TriVS);
const GLchar *triUniVS[] = {
"#version 150 core\n"
"uniform vec2 offset;"
"uniform vec2 wndSize;"
"uniform vec4 color;"
"in vec2 vertex;"
"out vec4 fcolor;"
"void main() { gl_Position = vec4(2.0*(vertex.x+offset.x-0.5)/wndSize.x - 1.0, 1.0 - 2.0*(vertex.y+offset.y-0.5)/wndSize.y, 0, 1); fcolor = color; }"
};
m_TriUniVS = _glCreateShader(GL_VERTEX_SHADER);
_glShaderSource(m_TriUniVS, 1, triUniVS, NULL);
CompileShader(m_TriUniVS);
m_TriFS = m_TriUniFS = m_LineRectFS;
m_TriProgram = _glCreateProgram();
_glAttachShader(m_TriProgram, m_TriVS);
_glAttachShader(m_TriProgram, m_TriFS);
_glBindAttribLocation(m_TriProgram, 0, "vertex");
_glBindAttribLocation(m_TriProgram, 1, "color");
LinkProgram(m_TriProgram);
m_TriLocationOffset = _glGetUniformLocation(m_TriProgram, "offset");
m_TriLocationWndSize = _glGetUniformLocation(m_TriProgram, "wndSize");
m_TriUniProgram = _glCreateProgram();
_glAttachShader(m_TriUniProgram, m_TriUniVS);
_glAttachShader(m_TriUniProgram, m_TriUniFS);
_glBindAttribLocation(m_TriUniProgram, 0, "vertex");
_glBindAttribLocation(m_TriUniProgram, 1, "color");
LinkProgram(m_TriUniProgram);
m_TriUniLocationOffset = _glGetUniformLocation(m_TriUniProgram, "offset");
m_TriUniLocationWndSize = _glGetUniformLocation(m_TriUniProgram, "wndSize");
m_TriUniLocationColor = _glGetUniformLocation(m_TriUniProgram, "color");
const GLchar *triTexFS[] = {
"#version 150 core\n"
"precision highp float;"
"uniform sampler2D tex;"
"in vec2 fuv;"
"in vec4 fcolor;"
"out vec4 outColor;"
"void main() { outColor.rgb = fcolor.bgr; outColor.a = fcolor.a * texture2D(tex, fuv).r; }"
};
m_TriTexFS = _glCreateShader(GL_FRAGMENT_SHADER);
_glShaderSource(m_TriTexFS, 1, triTexFS, NULL);
CompileShader(m_TriTexFS);
const GLchar *triTexVS[] = {
"#version 150 core\n"
"uniform vec2 offset;"
"uniform vec2 wndSize;"
"in vec2 vertex;"
"in vec2 uv;"
"in vec4 color;"
"out vec2 fuv;"
"out vec4 fcolor;"
"void main() { gl_Position = vec4(2.0*(vertex.x+offset.x-0.5)/wndSize.x - 1.0, 1.0 - 2.0*(vertex.y+offset.y-0.5)/wndSize.y, 0, 1); fuv = uv; fcolor = color; }"
};
m_TriTexVS = _glCreateShader(GL_VERTEX_SHADER);
_glShaderSource(m_TriTexVS, 1, triTexVS, NULL);
CompileShader(m_TriTexVS);
const GLchar *triTexUniVS[] = {
"#version 150 core\n"
"uniform vec2 offset;"
"uniform vec2 wndSize;"
"uniform vec4 color;"
"in vec2 vertex;"
"in vec2 uv;"
"out vec4 fcolor;"
"out vec2 fuv;"
"void main() { gl_Position = vec4(2.0*(vertex.x+offset.x-0.5)/wndSize.x - 1.0, 1.0 - 2.0*(vertex.y+offset.y-0.5)/wndSize.y, 0, 1); fuv = uv; fcolor = color; }"
};
m_TriTexUniVS = _glCreateShader(GL_VERTEX_SHADER);
_glShaderSource(m_TriTexUniVS, 1, triTexUniVS, NULL);
CompileShader(m_TriTexUniVS);
m_TriTexUniFS = m_TriTexFS;
m_TriTexProgram = _glCreateProgram();
_glAttachShader(m_TriTexProgram, m_TriTexVS);
_glAttachShader(m_TriTexProgram, m_TriTexFS);
_glBindAttribLocation(m_TriTexProgram, 0, "vertex");
_glBindAttribLocation(m_TriTexProgram, 1, "uv");
_glBindAttribLocation(m_TriTexProgram, 2, "color");
LinkProgram(m_TriTexProgram);
m_TriTexLocationOffset = _glGetUniformLocation(m_TriTexProgram, "offset");
m_TriTexLocationWndSize = _glGetUniformLocation(m_TriTexProgram, "wndSize");
m_TriTexLocationTexture = _glGetUniformLocation(m_TriTexProgram, "tex");
m_TriTexUniProgram = _glCreateProgram();
_glAttachShader(m_TriTexUniProgram, m_TriTexUniVS);
_glAttachShader(m_TriTexUniProgram, m_TriTexUniFS);
_glBindAttribLocation(m_TriTexUniProgram, 0, "vertex");
_glBindAttribLocation(m_TriTexUniProgram, 1, "uv");
_glBindAttribLocation(m_TriTexUniProgram, 2, "color");
LinkProgram(m_TriTexUniProgram);
m_TriTexUniLocationOffset = _glGetUniformLocation(m_TriTexUniProgram, "offset");
m_TriTexUniLocationWndSize = _glGetUniformLocation(m_TriTexUniProgram, "wndSize");
m_TriTexUniLocationColor = _glGetUniformLocation(m_TriTexUniProgram, "color");
m_TriTexUniLocationTexture = _glGetUniformLocation(m_TriTexUniProgram, "tex");
// Create tri vertex buffer
_glGenVertexArrays(1, &m_TriVArray);
_glGenBuffers(1, &m_TriVertices);
_glGenBuffers(1, &m_TriUVs);
_glGenBuffers(1, &m_TriColors);
ResizeTriBuffers(16384); // set initial size
CHECK_GL_ERROR;
return 1;
}
// ---------------------------------------------------------------------------
int CTwGraphOpenGLCore::Shut()
{
assert(m_Drawing==false);
UnbindFont(m_FontTexID);
CHECK_GL_ERROR;
_glDeleteProgram(m_LineRectProgram); m_LineRectProgram = 0;
_glDeleteShader(m_LineRectVS); m_LineRectVS = 0;
_glDeleteShader(m_LineRectFS); m_LineRectFS = 0;
_glDeleteProgram(m_TriProgram); m_TriProgram = 0;
_glDeleteShader(m_TriVS); m_TriVS = 0;
_glDeleteProgram(m_TriUniProgram); m_TriUniProgram = 0;
_glDeleteShader(m_TriUniVS); m_TriUniVS = 0;
_glDeleteProgram(m_TriTexProgram); m_TriTexProgram = 0;
_glDeleteShader(m_TriTexVS); m_TriTexVS = 0;
_glDeleteShader(m_TriTexFS); m_TriTexFS = 0;
_glDeleteProgram(m_TriTexUniProgram); m_TriTexUniProgram = 0;
_glDeleteShader(m_TriTexUniVS); m_TriTexUniVS = 0;
_glDeleteBuffers(1, &m_LineRectVertices); m_LineRectVertices = 0;
_glDeleteBuffers(1, &m_LineRectColors); m_LineRectColors = 0;
_glDeleteVertexArrays(1, &m_LineRectVArray); m_LineRectVArray = 0;
_glDeleteBuffers(1, &m_TriVertices); m_TriVertices = 0;
_glDeleteBuffers(1, &m_TriColors); m_TriColors = 0;
_glDeleteBuffers(1, &m_TriUVs); m_TriUVs = 0;
_glDeleteVertexArrays(1, &m_TriVArray); m_TriVArray = 0;
CHECK_GL_ERROR;
int Res = 1;
if( UnloadOpenGLCore()==0 )
{
g_TwMgr->SetLastError(g_ErrCantUnloadOGL);
Res = 0;
}
return Res;
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::BeginDraw(int _WndWidth, int _WndHeight)
{
CHECK_GL_ERROR;
assert(m_Drawing==false && _WndWidth>0 && _WndHeight>0);
m_Drawing = true;
m_WndWidth = _WndWidth;
m_WndHeight = _WndHeight;
m_OffsetX = 0;
m_OffsetY = 0;
_glGetIntegerv(GL_VIEWPORT, m_PrevViewport); CHECK_GL_ERROR;
if( _WndWidth>0 && _WndHeight>0 )
{
GLint Vp[4];
Vp[0] = 0;
Vp[1] = 0;
Vp[2] = _WndWidth-1;
Vp[3] = _WndHeight-1;
_glViewport(Vp[0], Vp[1], Vp[2], Vp[3]);
}
m_PrevVArray = 0;
_glGetIntegerv(GL_VERTEX_ARRAY_BINDING, (GLint*)&m_PrevVArray); CHECK_GL_ERROR;
_glBindVertexArray(0); CHECK_GL_ERROR;
m_PrevLineWidth = 1;
_glGetFloatv(GL_LINE_WIDTH, &m_PrevLineWidth); CHECK_GL_ERROR;
_glLineWidth(1); CHECK_GL_ERROR;
m_PrevLineSmooth = _glIsEnabled(GL_LINE_SMOOTH);
_glDisable(GL_LINE_SMOOTH); CHECK_GL_ERROR;
m_PrevCullFace = _glIsEnabled(GL_CULL_FACE);
_glDisable(GL_CULL_FACE); CHECK_GL_ERROR;
m_PrevDepthTest = _glIsEnabled(GL_DEPTH_TEST);
_glDisable(GL_DEPTH_TEST); CHECK_GL_ERROR;
m_PrevBlend = _glIsEnabled(GL_BLEND);
_glEnable(GL_BLEND); CHECK_GL_ERROR;
m_PrevScissorTest = _glIsEnabled(GL_SCISSOR_TEST);
_glDisable(GL_SCISSOR_TEST); CHECK_GL_ERROR;
_glGetIntegerv(GL_SCISSOR_BOX, m_PrevScissorBox); CHECK_GL_ERROR;
_glGetIntegerv(GL_BLEND_SRC, &m_PrevSrcBlend); CHECK_GL_ERROR;
_glGetIntegerv(GL_BLEND_DST, &m_PrevDstBlend); CHECK_GL_ERROR;
_glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); CHECK_GL_ERROR;
m_PrevTexture = 0;
_glGetIntegerv(GL_TEXTURE_BINDING_2D, &m_PrevTexture); CHECK_GL_ERROR;
_glBindTexture(GL_TEXTURE_2D, 0); CHECK_GL_ERROR;
m_PrevProgramObject = 0;
_glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&m_PrevProgramObject); CHECK_GL_ERROR;
_glBindVertexArray(0); CHECK_GL_ERROR;
_glUseProgram(0); CHECK_GL_ERROR;
m_PrevActiveTexture = 0;
_glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint*)&m_PrevActiveTexture); CHECK_GL_ERROR;
_glActiveTexture(GL_TEXTURE0);
CHECK_GL_ERROR;
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::EndDraw()
{
assert(m_Drawing==true);
m_Drawing = false;
_glLineWidth(m_PrevLineWidth); CHECK_GL_ERROR;
if( m_PrevLineSmooth )
{
_glEnable(GL_LINE_SMOOTH); CHECK_GL_ERROR;
}
else
{
_glDisable(GL_LINE_SMOOTH); CHECK_GL_ERROR;
}
if( m_PrevCullFace )
{
_glEnable(GL_CULL_FACE); CHECK_GL_ERROR;
}
else
{
_glDisable(GL_CULL_FACE); CHECK_GL_ERROR;
}
if( m_PrevDepthTest )
{
_glEnable(GL_DEPTH_TEST); CHECK_GL_ERROR;
}
else
{
_glDisable(GL_DEPTH_TEST); CHECK_GL_ERROR;
}
if( m_PrevBlend )
{
_glEnable(GL_BLEND); CHECK_GL_ERROR;
}
else
{
_glDisable(GL_BLEND); CHECK_GL_ERROR;
}
if( m_PrevScissorTest )
{
_glEnable(GL_SCISSOR_TEST); CHECK_GL_ERROR;
}
else
{
_glDisable(GL_SCISSOR_TEST); CHECK_GL_ERROR;
}
_glScissor(m_PrevScissorBox[0], m_PrevScissorBox[1], m_PrevScissorBox[2], m_PrevScissorBox[3]); CHECK_GL_ERROR;
_glBlendFunc(m_PrevSrcBlend, m_PrevDstBlend); CHECK_GL_ERROR;
_glBindTexture(GL_TEXTURE_2D, m_PrevTexture); CHECK_GL_ERROR;
_glUseProgram(m_PrevProgramObject); CHECK_GL_ERROR;
_glBindVertexArray(m_PrevVArray); CHECK_GL_ERROR;
_glViewport(m_PrevViewport[0], m_PrevViewport[1], m_PrevViewport[2], m_PrevViewport[3]); CHECK_GL_ERROR;
CHECK_GL_ERROR;
}
// ---------------------------------------------------------------------------
bool CTwGraphOpenGLCore::IsDrawing()
{
return m_Drawing;
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::Restore()
{
UnbindFont(m_FontTexID);
m_FontTexID = 0;
m_FontTex = NULL;
}
// ---------------------------------------------------------------------------
static inline float ToNormScreenX(float x, int wndWidth)
{
return 2.0f*((float)x-0.5f)/wndWidth - 1.0f;
}
static inline float ToNormScreenY(float y, int wndHeight)
{
return 1.0f - 2.0f*((float)y-0.5f)/wndHeight;
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased)
{
CHECK_GL_ERROR;
assert(m_Drawing==true);
//const GLfloat dx = +0.0f;
const GLfloat dx = 0;
//GLfloat dy = -0.2f;
const GLfloat dy = -0.5f;
if( _AntiAliased )
_glEnable(GL_LINE_SMOOTH);
else
_glDisable(GL_LINE_SMOOTH);
_glBindVertexArray(m_LineRectVArray);
GLfloat x0 = ToNormScreenX(_X0+dx + m_OffsetX, m_WndWidth);
GLfloat y0 = ToNormScreenY(_Y0+dy + m_OffsetY, m_WndHeight);
GLfloat x1 = ToNormScreenX(_X1+dx + m_OffsetX, m_WndWidth);
GLfloat y1 = ToNormScreenY(_Y1+dy + m_OffsetY, m_WndHeight);
GLfloat vertices[] = { x0,y0,0, x1,y1,0 };
_glBindBuffer(GL_ARRAY_BUFFER, m_LineRectVertices);
_glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
_glVertexAttribPointer(0, 3, GL_FLOAT, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(0);
color32 colors[] = { _Color0, _Color1 };
_glBindBuffer(GL_ARRAY_BUFFER, m_LineRectColors);
_glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(colors), colors);
_glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(1);
_glUseProgram(m_LineRectProgram);
_glDrawArrays(GL_LINES, 0, 2);
if( _AntiAliased )
_glDisable(GL_LINE_SMOOTH);
CHECK_GL_ERROR;
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11)
{
CHECK_GL_ERROR;
assert(m_Drawing==true);
// border adjustment
if(_X0<_X1)
++_X1;
else if(_X0>_X1)
++_X0;
if(_Y0<_Y1)
--_Y0;
else if(_Y0>_Y1)
--_Y1;
_glBindVertexArray(m_LineRectVArray);
GLfloat x0 = ToNormScreenX((float)_X0 + m_OffsetX, m_WndWidth);
GLfloat y0 = ToNormScreenY((float)_Y0 + m_OffsetY, m_WndHeight);
GLfloat x1 = ToNormScreenX((float)_X1 + m_OffsetX, m_WndWidth);
GLfloat y1 = ToNormScreenY((float)_Y1 + m_OffsetY, m_WndHeight);
GLfloat vertices[] = { x0,y0,0, x1,y0,0, x0,y1,0, x1,y1,0 };
_glBindBuffer(GL_ARRAY_BUFFER, m_LineRectVertices);
_glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
_glVertexAttribPointer(0, 3, GL_FLOAT, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(0);
GLuint colors[] = { _Color00, _Color10, _Color01, _Color11 };
_glBindBuffer(GL_ARRAY_BUFFER, m_LineRectColors);
_glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(colors), colors);
_glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(1);
_glUseProgram(m_LineRectProgram);
_glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
CHECK_GL_ERROR;
}
// ---------------------------------------------------------------------------
void *CTwGraphOpenGLCore::NewTextObj()
{
return new CTextObj;
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::DeleteTextObj(void *_TextObj)
{
assert(_TextObj!=NULL);
delete static_cast<CTextObj *>(_TextObj);
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth)
{
assert(m_Drawing==true);
assert(_TextObj!=NULL);
assert(_Font!=NULL);
if( _Font != m_FontTex )
{
UnbindFont(m_FontTexID);
m_FontTexID = BindFont(_Font);
m_FontTex = _Font;
}
CTextObj *TextObj = static_cast<CTextObj *>(_TextObj);
TextObj->m_TextVerts.resize(0);
TextObj->m_TextUVs.resize(0);
TextObj->m_BgVerts.resize(0);
TextObj->m_Colors.resize(0);
TextObj->m_BgColors.resize(0);
int x, x1, y, y1, i, Len;
unsigned char ch;
const unsigned char *Text;
color32 LineColor = COLOR32_RED;
for( int Line=0; Line<_NbLines; ++Line )
{
x = 0;
y = Line * (_Font->m_CharHeight+_Sep);
y1 = y+_Font->m_CharHeight;
Len = (int)_TextLines[Line].length();
Text = (const unsigned char *)(_TextLines[Line].c_str());
if( _LineColors!=NULL )
LineColor = (_LineColors[Line]&0xff00ff00) | GLubyte(_LineColors[Line]>>16) | (GLubyte(_LineColors[Line])<<16);
for( i=0; i<Len; ++i )
{
ch = Text[i];
x1 = x + _Font->m_CharWidth[ch];
TextObj->m_TextVerts.push_back(Vec2(x , y ));
TextObj->m_TextVerts.push_back(Vec2(x1, y ));
TextObj->m_TextVerts.push_back(Vec2(x , y1));
TextObj->m_TextVerts.push_back(Vec2(x1, y ));
TextObj->m_TextVerts.push_back(Vec2(x1, y1));
TextObj->m_TextVerts.push_back(Vec2(x , y1));
TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU0[ch], _Font->m_CharV0[ch]));
TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU1[ch], _Font->m_CharV0[ch]));
TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU0[ch], _Font->m_CharV1[ch]));
TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU1[ch], _Font->m_CharV0[ch]));
TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU1[ch], _Font->m_CharV1[ch]));
TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU0[ch], _Font->m_CharV1[ch]));
if( _LineColors!=NULL )
{
TextObj->m_Colors.push_back(LineColor);
TextObj->m_Colors.push_back(LineColor);
TextObj->m_Colors.push_back(LineColor);
TextObj->m_Colors.push_back(LineColor);
TextObj->m_Colors.push_back(LineColor);
TextObj->m_Colors.push_back(LineColor);
}
x = x1;
}
if( _BgWidth>0 )
{
TextObj->m_BgVerts.push_back(Vec2(-1 , y ));
TextObj->m_BgVerts.push_back(Vec2(_BgWidth+1, y ));
TextObj->m_BgVerts.push_back(Vec2(-1 , y1));
TextObj->m_BgVerts.push_back(Vec2(_BgWidth+1, y ));
TextObj->m_BgVerts.push_back(Vec2(_BgWidth+1, y1));
TextObj->m_BgVerts.push_back(Vec2(-1 , y1));
if( _LineBgColors!=NULL )
{
color32 LineBgColor = (_LineBgColors[Line]&0xff00ff00) | GLubyte(_LineBgColors[Line]>>16) | (GLubyte(_LineBgColors[Line])<<16);
TextObj->m_BgColors.push_back(LineBgColor);
TextObj->m_BgColors.push_back(LineBgColor);
TextObj->m_BgColors.push_back(LineBgColor);
TextObj->m_BgColors.push_back(LineBgColor);
TextObj->m_BgColors.push_back(LineBgColor);
TextObj->m_BgColors.push_back(LineBgColor);
}
}
}
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor)
{
CHECK_GL_ERROR;
assert(m_Drawing==true);
assert(_TextObj!=NULL);
CTextObj *TextObj = static_cast<CTextObj *>(_TextObj);
if( TextObj->m_TextVerts.size()<4 && TextObj->m_BgVerts.size()<4 )
return; // nothing to draw
// draw character background triangles
if( (_BgColor!=0 || TextObj->m_BgColors.size()==TextObj->m_BgVerts.size()) && TextObj->m_BgVerts.size()>=4 )
{
size_t numBgVerts = TextObj->m_BgVerts.size();
if( numBgVerts > m_TriBufferSize )
ResizeTriBuffers(numBgVerts + 2048);
_glBindVertexArray(m_TriVArray);
_glBindBuffer(GL_ARRAY_BUFFER, m_TriVertices);
_glBufferSubData(GL_ARRAY_BUFFER, 0, numBgVerts*sizeof(Vec2), &(TextObj->m_BgVerts[0]));
_glVertexAttribPointer(0, 2, GL_FLOAT, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(0);
_glDisableVertexAttribArray(1);
_glDisableVertexAttribArray(2);
if( TextObj->m_BgColors.size()==TextObj->m_BgVerts.size() && _BgColor==0 )
{
_glBindBuffer(GL_ARRAY_BUFFER, m_TriColors);
_glBufferSubData(GL_ARRAY_BUFFER, 0, numBgVerts*sizeof(color32), &(TextObj->m_BgColors[0]));
_glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(1);
_glUseProgram(m_TriProgram);
_glUniform2f(m_TriLocationOffset, (float)_X, (float)_Y);
_glUniform2f(m_TriLocationWndSize, (float)m_WndWidth, (float)m_WndHeight);
}
else
{
_glUseProgram(m_TriUniProgram);
_glUniform4f(m_TriUniLocationColor, GLfloat((_BgColor>>16)&0xff)/256.0f, GLfloat((_BgColor>>8)&0xff)/256.0f, GLfloat(_BgColor&0xff)/256.0f, GLfloat((_BgColor>>24)&0xff)/256.0f);
_glUniform2f(m_TriUniLocationOffset, (float)_X, (float)_Y);
_glUniform2f(m_TriUniLocationWndSize, (float)m_WndWidth, (float)m_WndHeight);
}
_glDrawArrays(GL_TRIANGLES, 0, (GLsizei)TextObj->m_BgVerts.size());
}
// draw character triangles
if( TextObj->m_TextVerts.size()>=4 )
{
_glActiveTexture(GL_TEXTURE0);
_glBindTexture(GL_TEXTURE_2D, m_FontTexID);
size_t numTextVerts = TextObj->m_TextVerts.size();
if( numTextVerts > m_TriBufferSize )
ResizeTriBuffers(numTextVerts + 2048);
_glBindVertexArray(m_TriVArray);
_glDisableVertexAttribArray(2);
_glBindBuffer(GL_ARRAY_BUFFER, m_TriVertices);
_glBufferSubData(GL_ARRAY_BUFFER, 0, numTextVerts*sizeof(Vec2), &(TextObj->m_TextVerts[0]));
_glVertexAttribPointer(0, 2, GL_FLOAT, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(0);
_glBindBuffer(GL_ARRAY_BUFFER, m_TriUVs);
_glBufferSubData(GL_ARRAY_BUFFER, 0, numTextVerts*sizeof(Vec2), &(TextObj->m_TextUVs[0]));
_glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, NULL);
_glEnableVertexAttribArray(1);
if( TextObj->m_Colors.size()==TextObj->m_TextVerts.size() && _Color==0 )
{
_glBindBuffer(GL_ARRAY_BUFFER, m_TriColors);
_glBufferSubData(GL_ARRAY_BUFFER, 0, numTextVerts*sizeof(color32), &(TextObj->m_Colors[0]));
_glVertexAttribPointer(2, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(2);
_glUseProgram(m_TriTexProgram);
_glUniform2f(m_TriTexLocationOffset, (float)_X, (float)_Y);
_glUniform2f(m_TriTexLocationWndSize, (float)m_WndWidth, (float)m_WndHeight);
_glUniform1i(m_TriTexLocationTexture, 0);
}
else
{
_glUseProgram(m_TriTexUniProgram);
_glUniform4f(m_TriTexUniLocationColor, GLfloat((_Color>>16)&0xff)/256.0f, GLfloat((_Color>>8)&0xff)/256.0f, GLfloat(_Color&0xff)/256.0f, GLfloat((_Color>>24)&0xff)/256.0f);
_glUniform2f(m_TriTexUniLocationOffset, (float)_X, (float)_Y);
_glUniform2f(m_TriTexUniLocationWndSize, (float)m_WndWidth, (float)m_WndHeight);
_glUniform1i(m_TriTexUniLocationTexture, 0);
}
_glDrawArrays(GL_TRIANGLES, 0, (GLsizei)TextObj->m_TextVerts.size());
}
CHECK_GL_ERROR;
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY)
{
// glViewport impacts the NDC; use glScissor instead
m_OffsetX = _X0 + _OffsetX;
m_OffsetY = _Y0 + _OffsetY;
SetScissor(_X0, _Y0, _Width, _Height);
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::RestoreViewport()
{
m_OffsetX = m_OffsetY = 0;
SetScissor(0, 0, 0, 0);
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::SetScissor(int _X0, int _Y0, int _Width, int _Height)
{
if( _Width>0 && _Height>0 )
{
_glScissor(_X0-1, m_WndHeight-_Y0-_Height, _Width-1, _Height);
_glEnable(GL_SCISSOR_TEST);
}
else
_glDisable(GL_SCISSOR_TEST);
}
// ---------------------------------------------------------------------------
void CTwGraphOpenGLCore::DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode)
{
assert(m_Drawing==true);
const GLfloat dx = +0.0f;
const GLfloat dy = +0.0f;
// Backup states
GLint prevCullFaceMode, prevFrontFace;
_glGetIntegerv(GL_CULL_FACE_MODE, &prevCullFaceMode);
_glGetIntegerv(GL_FRONT_FACE, &prevFrontFace);
GLboolean prevCullEnable = _glIsEnabled(GL_CULL_FACE);
_glCullFace(GL_BACK);
_glEnable(GL_CULL_FACE);
if( _CullMode==CULL_CW )
_glFrontFace(GL_CCW);
else if( _CullMode==CULL_CCW )
_glFrontFace(GL_CW);
else
_glDisable(GL_CULL_FACE);
_glUseProgram(m_TriProgram);
_glBindVertexArray(m_TriVArray);
_glUniform2f(m_TriLocationOffset, (float)m_OffsetX+dx, (float)m_OffsetY+dy);
_glUniform2f(m_TriLocationWndSize, (float)m_WndWidth, (float)m_WndHeight);
_glDisableVertexAttribArray(2);
size_t numVerts = 3*_NumTriangles;
if( numVerts > m_TriBufferSize )
ResizeTriBuffers(numVerts + 2048);
_glBindBuffer(GL_ARRAY_BUFFER, m_TriVertices);
_glBufferSubData(GL_ARRAY_BUFFER, 0, numVerts*2*sizeof(int), _Vertices);
_glVertexAttribPointer(0, 2, GL_INT, GL_FALSE, 0, NULL);
_glEnableVertexAttribArray(0);
_glBindBuffer(GL_ARRAY_BUFFER, m_TriColors);
_glBufferSubData(GL_ARRAY_BUFFER, 0, numVerts*sizeof(color32), _Colors);
_glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL);
_glEnableVertexAttribArray(1);
_glDrawArrays(GL_TRIANGLES, 0, (GLsizei)numVerts);
// Reset states
_glCullFace(prevCullFaceMode);
_glFrontFace(prevFrontFace);
if( prevCullEnable )
_glEnable(GL_CULL_FACE);
else
_glDisable(GL_CULL_FACE);
CHECK_GL_ERROR;
}
// ---------------------------------------------------------------------------

View File

@@ -0,0 +1,121 @@
// ---------------------------------------------------------------------------
//
// @file TwOpenGLCore.h
// @brief OpenGL Core graph functions
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// For conditions of distribution and use, see License.txt
//
// note: Private header
//
// ---------------------------------------------------------------------------
#if !defined ANT_TW_OPENGL_CORE_INCLUDED
#define ANT_TW_OPENGL_CORE_INCLUDED
#include "TwGraph.h"
// ---------------------------------------------------------------------------
class CTwGraphOpenGLCore : public ITwGraph
{
public:
virtual int Init();
virtual int Shut();
virtual void BeginDraw(int _WndWidth, int _WndHeight);
virtual void EndDraw();
virtual bool IsDrawing();
virtual void Restore();
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false);
virtual void DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) { DrawLine(_X0, _Y0, _X1, _Y1, _Color, _Color, _AntiAliased); }
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11);
virtual void DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) { DrawRect(_X0, _Y0, _X1, _Y1, _Color, _Color, _Color, _Color); }
virtual void DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode);
virtual void * NewTextObj();
virtual void DeleteTextObj(void *_TextObj);
virtual void BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth);
virtual void DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor);
virtual void ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY);
virtual void RestoreViewport();
virtual void SetScissor(int _X0, int _Y0, int _Width, int _Height);
protected:
bool m_Drawing;
GLuint m_FontTexID;
const CTexFont * m_FontTex;
GLfloat m_PrevLineWidth;
GLint m_PrevActiveTexture;
GLint m_PrevTexture;
GLint m_PrevVArray;
GLboolean m_PrevLineSmooth;
GLboolean m_PrevCullFace;
GLboolean m_PrevDepthTest;
GLboolean m_PrevBlend;
GLint m_PrevSrcBlend;
GLint m_PrevDstBlend;
GLboolean m_PrevScissorTest;
GLint m_PrevScissorBox[4];
GLint m_PrevViewport[4];
GLuint m_PrevProgramObject;
GLuint m_LineRectVS;
GLuint m_LineRectFS;
GLuint m_LineRectProgram;
GLuint m_LineRectVArray;
GLuint m_LineRectVertices;
GLuint m_LineRectColors;
GLuint m_TriVS;
GLuint m_TriFS;
GLuint m_TriProgram;
GLuint m_TriUniVS;
GLuint m_TriUniFS;
GLuint m_TriUniProgram;
GLuint m_TriTexVS;
GLuint m_TriTexFS;
GLuint m_TriTexProgram;
GLuint m_TriTexUniVS;
GLuint m_TriTexUniFS;
GLuint m_TriTexUniProgram;
GLuint m_TriVArray;
GLuint m_TriVertices;
GLuint m_TriUVs;
GLuint m_TriColors;
GLint m_TriLocationOffset;
GLint m_TriLocationWndSize;
GLint m_TriUniLocationOffset;
GLint m_TriUniLocationWndSize;
GLint m_TriUniLocationColor;
GLint m_TriTexLocationOffset;
GLint m_TriTexLocationWndSize;
GLint m_TriTexLocationTexture;
GLint m_TriTexUniLocationOffset;
GLint m_TriTexUniLocationWndSize;
GLint m_TriTexUniLocationColor;
GLint m_TriTexUniLocationTexture;
size_t m_TriBufferSize;
int m_WndWidth;
int m_WndHeight;
int m_OffsetX;
int m_OffsetY;
struct Vec2 { GLfloat x, y; Vec2(){} Vec2(GLfloat _X, GLfloat _Y):x(_X),y(_Y){} Vec2(int _X, int _Y):x(GLfloat(_X)),y(GLfloat(_Y)){} };
struct CTextObj
{
std::vector<Vec2> m_TextVerts;
std::vector<Vec2> m_TextUVs;
std::vector<Vec2> m_BgVerts;
std::vector<color32>m_Colors;
std::vector<color32>m_BgColors;
};
void ResizeTriBuffers(size_t _NewSize);
};
// ---------------------------------------------------------------------------
#endif // !defined ANT_TW_OPENGL_CORE_INCLUDED

View File

@@ -1,16 +1,14 @@
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
// @file TwPrecomp.h
// @brief Precompiled header
// @author Philippe Decaudin - http://www.antisphere.com
// @file TwPrecomp.h
// @brief Precompiled header
// @author Philippe Decaudin - http://www.antisphere.com
// @license This file is part of the AntTweakBar library.
// Copyright <20> 2005, 2006 Philippe Decaudin.
// For conditions of distribution and use, see License.txt
//
// notes: Private header
// TAB=4
// note: Private header
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
#if !defined ANT_TW_PRECOMP_INCLUDED
@@ -18,48 +16,78 @@
#if defined _MSC_VER
# pragma warning(disable: 4514) // unreferenced inline function has been removed
# pragma warning(disable: 4710) // function not inlined
# pragma warning(disable: 4786) // template name truncated
# pragma warning(disable: 4530) // exceptions not handled
# define _CRT_SECURE_NO_DEPRECATE // visual 8 secure crt warning
# pragma warning(disable: 4514) // unreferenced inline function has been removed
# pragma warning(disable: 4710) // function not inlined
# pragma warning(disable: 4786) // template name truncated
# pragma warning(disable: 4530) // exceptions not handled
# define _CRT_SECURE_NO_DEPRECATE // visual 8 secure crt warning
#endif
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <float.h>
#include <cstdio>
#include <cassert>
#include <cmath>
#include <cfloat>
#include <cstring>
#include <cstdlib>
#include <memory.h>
#if defined(_MSC_VER) && _MSC_VER<=1200
# pragma warning(push, 3)
# pragma warning(push, 3)
#endif
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <list>
#include <set>
#if defined(_MSC_VER) && _MSC_VER<=1200
# pragma warning(pop)
# pragma warning(pop)
#endif
#if defined(_UNIX)
# define ANT_UNIX
# include <X11/cursorfont.h>
# include <GL/glx.h>
# undef _WIN32
# undef WIN32
# undef _WIN64
# undef WIN64
# undef _WINDOWS
# undef ANT_WINDOWS
# define ANT_UNIX
# include <X11/cursorfont.h>
# define GLX_GLXEXT_LEGACY
# include <GL/glx.h>
# include <X11/Xatom.h>
# include <unistd.h>
# include <malloc.h>
# undef _WIN32
# undef WIN32
# undef _WIN64
# undef WIN64
# undef _WINDOWS
# undef ANT_WINDOWS
# undef ANT_OSX
#elif defined(_MACOSX)
# define ANT_OSX
# include <unistd.h>
# include <Foundation/Foundation.h>
# include <AppKit/NSImage.h>
# include <AppKit/NSCursor.h>
# undef _WIN32
# undef WIN32
# undef _WIN64
# undef WIN64
# undef _WINDOWS
# undef ANT_WINDOWS
# undef ANT_UNIX
#elif defined(_WINDOWS) || defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)
# define ANT_WINDOWS
# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
# include <windows.h>
# include <shellapi.h>
#endif // defined _WINDOWS
# define ANT_WINDOWS
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
# endif
# include <windows.h>
# include <shellapi.h>
#endif
#include <GL/gl.h> // must be included after windows.h
#define ANT_OGL_HEADER_INCLUDED
#if !defined(ANT_OGL_HEADER_INCLUDED)
# if defined(ANT_OSX)
# include <OpenGL/gl.h>
# else
# include <GL/gl.h> // must be included after windows.h
# endif
# define ANT_OGL_HEADER_INCLUDED
#endif
#endif // !defined ANT_TW_PRECOMP_INCLUDED
#endif // !defined ANT_TW_PRECOMP_INCLUDED

View File

@@ -0,0 +1,46 @@
// Workaround to include D3D10.h with VS2003
#ifndef __out
#define __out
#endif
#ifndef __in
#define __in
#endif
#ifndef __inout
#define __inout
#endif
#ifndef __in_opt
#define __in_opt
#endif
#ifndef __out_opt
#define __out_opt
#endif
#ifndef __inout_opt
#define __inout_opt
#endif
#ifndef __in_ecount
#define __in_ecount(x)
#endif
#ifndef __in_ecount_opt
#define __in_ecount_opt(x)
#endif
#ifndef __out_ecount
#define __out_ecount(x)
#endif
#ifndef __out_ecount_opt
#define __out_ecount_opt(x)
#endif
#ifndef __inout_ecount
#define __inout_ecount(x)
#endif
#ifndef __inout_ecount_opt
#define __inout_ecount_opt(x)
#endif
#ifndef __in_bcount_opt
#define __in_bcount_opt(x)
#endif
#ifndef __out_bcount_opt
#define __out_bcount_opt(x)
#endif
#ifndef __inout_bcount_opt
#define __inout_bcount_opt(x)
#endif

View File

@@ -1,10 +1,10 @@
!"#$%&'()*+,-./0123456789:;<=>?
 !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
`abcdefghijklmnopqrstuvwxyz{|}~
€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ
 ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß
àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
032
033 !
@@ -101,132 +101,132 @@
124 |
125 }
126 ~
127 
128 <EFBFBD>
129 <EFBFBD>
130 <EFBFBD>
131 <EFBFBD>
132 <EFBFBD>
133 <EFBFBD>
134 <EFBFBD>
135 <EFBFBD>
136 <EFBFBD>
137 <EFBFBD>
138 <EFBFBD>
139 <EFBFBD>
140 <EFBFBD>
141 <EFBFBD>
142 <EFBFBD>
143 <EFBFBD>
144 <EFBFBD>
145 <EFBFBD>
146 <EFBFBD>
147 <EFBFBD>
148 <EFBFBD>
149 <EFBFBD>
150 <EFBFBD>
151 <EFBFBD>
152 <EFBFBD>
153 <EFBFBD>
154 <EFBFBD>
155 <EFBFBD>
156 <EFBFBD>
157 <EFBFBD>
158 <EFBFBD>
159 <EFBFBD>
160 <EFBFBD>
161 <EFBFBD>
162 <EFBFBD>
163 <EFBFBD>
164 <EFBFBD>
165 <EFBFBD>
166 <EFBFBD>
167 <EFBFBD>
168 <EFBFBD>
169 <EFBFBD>
170 <EFBFBD>
171 <EFBFBD>
172 <EFBFBD>
173 <EFBFBD>
174 <EFBFBD>
175 <EFBFBD>
176 <EFBFBD>
177 <EFBFBD>
178 <EFBFBD>
179 <EFBFBD>
180 <EFBFBD>
181 <EFBFBD>
182 <EFBFBD>
183 <EFBFBD>
184 <EFBFBD>
185 <EFBFBD>
186 <EFBFBD>
187 <EFBFBD>
188 <EFBFBD>
189 <EFBFBD>
190 <EFBFBD>
191 <EFBFBD>
192 <EFBFBD>
193 <EFBFBD>
194 <EFBFBD>
195 <EFBFBD>
196 <EFBFBD>
197 <EFBFBD>
198 <EFBFBD>
199 <EFBFBD>
200 <EFBFBD>
201 <EFBFBD>
202 <EFBFBD>
203 <EFBFBD>
204 <EFBFBD>
205 <EFBFBD>
206 <EFBFBD>
207 <EFBFBD>
208 <EFBFBD>
209 <EFBFBD>
210 <EFBFBD>
211 <EFBFBD>
212 <EFBFBD>
213 <EFBFBD>
214 <EFBFBD>
215 <EFBFBD>
216 <EFBFBD>
217 <EFBFBD>
218 <EFBFBD>
219 <EFBFBD>
220 <EFBFBD>
221 <EFBFBD>
222 <EFBFBD>
223 <EFBFBD>
224 <EFBFBD>
225 <EFBFBD>
226 <EFBFBD>
227 <EFBFBD>
228 <EFBFBD>
229 <EFBFBD>
230 <EFBFBD>
231 <EFBFBD>
232 <EFBFBD>
233 <EFBFBD>
234 <EFBFBD>
235 <EFBFBD>
236 <EFBFBD>
237 <EFBFBD>
238 <EFBFBD>
239 <EFBFBD>
240 <EFBFBD>
241 <EFBFBD>
242 <EFBFBD>
243 <EFBFBD>
244 <EFBFBD>
245 <EFBFBD>
246 <EFBFBD>
247 <EFBFBD>
248 <EFBFBD>
249 <EFBFBD>
250 <EFBFBD>
251 <EFBFBD>
252 <EFBFBD>
253 <EFBFBD>
254 <EFBFBD>
255 <EFBFBD>
127 
128
129 
130
131 ƒ
132
133
134
135
136 ˆ
137
138 Š
139
140 Œ
141 
142 Ž
143 
144 
145
146
147
148
149
150
151
152 ˜
153
154 š
155
156 œ
157 
158 ž
159 Ÿ
160  
161 ¡
162 ¢
163 £
164 ¤
165 ¥
166 ¦
167 §
168 ¨
169 ©
170 ª
171 «
172 ¬
173 ­
174 ®
175 ¯
176 °
177 ±
178 ²
179 ³
180 ´
181 µ
182
183 ·
184 ¸
185 ¹
186 º
187 »
188 ¼
189 ½
190 ¾
191 ¿
192 À
193 Á
194 Â
195 Ã
196 Ä
197 Å
198 Æ
199 Ç
200 È
201 É
202 Ê
203 Ë
204 Ì
205 Í
206 Î
207 Ï
208 Ð
209 Ñ
210 Ò
211 Ó
212 Ô
213 Õ
214 Ö
215 ×
216 Ø
217 Ù
218 Ú
219 Û
220 Ü
221 Ý
222 Þ
223 ß
224 à
225 á
226 â
227 ã
228 ä
229 å
230 æ
231 ç
232 è
233 é
234 ê
235 ë
236 ì
237 í
238 î
239 ï
240 ð
241 ñ
242 ò
243 ó
244 ô
245 õ
246 ö
247 ÷
248 ø
249 ù
250 ú
251 û
252 ü
253 ý
254 þ
255 ÿ

File diff suppressed because it is too large Load Diff

View File

@@ -8,24 +8,24 @@ P2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4
4 4 4 0 0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 59 245 125 175 225 21
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 0 0 0 0 0 0 0 0
0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 59 245 125 175 225 21
0 0 0 0 0 0 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 59 241 89 0 0 12 235 201 89 255 166 0 0 0 0 0 172 89 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 225 21 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 247 34 0 12
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 0
0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 138 247 34 0 12
232 89 138 225 21 0 0 0 0 138 125 7 199 34 0 0 0 0 138 125 0 0 0 0 138
255 255 201 0 0 0 59 215 21 0 0 0 0 59 245 255 255 166 0 0 0 59 241 89
0 7 206 201 0 0 89 251 89 0 59 215 21 172 89 59 192 0 0 0 0 0 0 0 0 0 0
@@ -34,8 +34,8 @@ P2
0 138 251 89 0 0 175 255 255 255 255 225 21 0 0 12 235 255 255 125 89 255
255 255 255 255 251 89 0 12 235 255 255 225 21 0 0 59 245 255 255 166 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 59 245 255 255 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 89 247
0 0 0 0 59 245 255 255 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4
4 4 4 0 0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 89 247
34 0 12 232 89 138 201 0 0 0 0 7 202 89 59 215 21 0 0 12 235 255 255 255
166 0 59 241 89 12 235 125 0 0 172 89 0 0 0 0 7 206 166 0 89 251 89 0 0
12 228 34 0 89 247 34 0 0 0 175 201 0 0 89 251 191 194 247 34 0 0 0 0 0
@@ -44,8 +44,8 @@ P2
166 0 0 0 0 89 255 251 89 0 0 175 201 0 0 0 0 0 0 89 255 125 0 0 0 0 0
0 0 0 89 251 89 12 235 166 0 7 206 201 0 59 245 125 0 12 235 166 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 89 166 0 0 138 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 89 247 34 0 12
0 89 166 0 0 138 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 0
0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 89 247 34 0 12
228 34 89 201 0 0 0 0 12 206 21 89 166 0 0 12 235 125 138 125 59 192 0
89 247 34 7 206 166 0 89 201 0 0 0 0 0 12 235 125 0 12 232 89 0 0 12 228
34 0 175 201 0 0 0 0 59 241 89 0 0 7 206 166 0 0 0 0 0 0 0 138 166 0 0
@@ -54,8 +54,8 @@ P2
241 89 0 0 175 201 0 0 0 0 0 7 206 166 0 0 0 0 0 0 0 0 7 206 201 0 59 241
89 0 0 138 225 21 138 225 21 0 0 138 225 21 89 255 125 0 0 89 255 125 0
0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 138 201 0 0 0 0 0 0 0 0
0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 89 247 34 0 0 0 0 0 0 0
0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 0 0 0 0 0
0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 89 247 34 0 0 0 0 0 0 0
0 89 255 255 255 255 255 255 255 125 59 238 34 138 125 0 0 0 89 247 34
7 206 166 7 202 89 0 0 0 0 0 0 175 225 21 138 225 21 0 0 0 0 0 12 235 125
0 0 0 0 7 206 125 0 89 251 191 194 247 34 0 0 0 0 0 138 166 0 0 0 0 0 0
@@ -64,8 +64,8 @@ P2
0 0 175 201 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 89 247 34 0 12 235 201
0 0 175 201 0 138 225 21 0 0 89 247 34 89 255 125 0 0 89 255 125 0 0 0
0 0 12 235 255 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 175 255 251 89 0 0 0 0
0 0 0 0 138 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 89 247 34 0 0 0 0 0
0 0 0 0 138 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 0 0 0
0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 89 247 34 0 0 0 0 0
0 0 0 0 0 175 125 7 199 34 0 0 12 235 166 138 125 0 0 0 59 241 89 12 235
125 89 201 12 235 255 251 89 0 0 7 206 255 166 0 59 241 89 0 0 0 59 238
34 0 0 0 0 0 175 166 59 215 21 172 89 59 192 0 0 0 0 0 138 166 0 0 0 0
@@ -75,7 +75,7 @@ P2
166 0 0 0 12 235 255 255 201 0 0 89 255 125 0 0 138 247 34 0 0 0 0 0 0
0 0 0 0 0 89 255 255 166 0 0 0 0 0 175 255 255 255 255 255 255 225 21 0
0 0 0 59 245 255 201 0 0 0 0 0 175 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0
0 0 0 0 0 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0
0 0 89 225 21 0 0 0 0 0 0 0 0 0 7 199 34 59 215 21 0 0 0 59 245 255 255
201 0 0 0 138 255 255 201 12 228 34 175 166 0 138 201 0 12 235 125 89 255
125 59 241 89 0 0 0 59 238 34 0 0 0 0 0 138 201 0 0 0 172 89 0 0 0 7 206
@@ -85,7 +85,7 @@ P2
251 89 0 0 175 225 21 0 0 89 247 34 0 0 7 206 166 0 175 255 166 0 0 89
255 255 255 223 247 34 0 0 0 0 0 0 0 0 0 0 175 247 34 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 225 21 0 0 175 225 21 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0
0 0 127 0 0 0 0 0 59 215 21 0 0 0 0 0 0 0 12 235 255 255 255 255 255 255
166 0 0 0 0 138 125 175 225 21 0 0 0 0 0 138 166 7 206 125 0 89 247 34
138 225 21 0 89 255 166 215 21 0 0 0 59 238 34 0 0 0 0 0 138 201 0 0 0
@@ -95,7 +95,7 @@ P2
247 34 0 0 59 241 89 0 7 206 166 0 0 0 138 247 34 0 0 138 247 34 0 0 0
0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 89 255 255 166 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 59 245 255 201 0 0 0 0 175 201 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0
127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 166 0 175 125 0 0 0 0 0 0 138
125 89 247 34 0 0 0 0 12 228 34 7 206 125 0 89 247 34 138 247 34 0 0 89
255 166 0 0 0 0 59 238 34 0 0 0 0 0 175 166 0 0 0 0 0 0 0 0 0 0 0 0 138
@@ -105,7 +105,7 @@ P2
0 0 0 138 247 34 0 0 89 251 89 0 0 0 0 7 206 166 0 0 0 0 0 0 0 0 0 0 0
0 0 0 12 235 255 225 21 0 0 175 255 255 255 255 255 255 225 21 0 0 175
255 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 89 247
4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 89 247
34 0 0 0 0 0 0 0 0 0 175 125 7 199 34 0 0 0 89 201 0 138 125 175 201 0
0 0 0 0 138 166 0 0 175 166 0 138 201 0 89 255 166 0 0 89 255 255 125 0
0 0 12 235 125 0 0 0 0 7 206 125 0 0 0 0 0 0 0 0 0 0 0 0 138 166 0 0 0
@@ -115,7 +115,7 @@ P2
206 166 0 0 0 0 59 245 166 0 7 206 225 21 0 0 0 0 175 225 21 0 89 255 125
0 0 12 235 201 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 138 201
0 0 0 0 0 0 0 0 0 175 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 89 247
4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0 0 0 89 247
34 0 0 0 0 0 0 0 0 7 199 34 59 215 21 0 0 0 12 235 255 255 255 201 0 0
0 0 0 59 215 21 0 0 12 235 255 251 89 0 0 89 255 255 255 201 0 89 255 0
0 0 0 175 201 0 0 0 0 59 238 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175
@@ -125,15 +125,15 @@ P2
225 21 0 138 247 34 0 0 0 0 0 59 245 255 255 201 0 0 0 175 255 255 201
0 0 0 89 255 125 0 0 89 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 175 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 247 34 0 0 0 175 201 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 232 89 0 0 0 0 0 0 0 0 0 0 175 125
0 0 0 0 4 4 4 4 4 4 4 4 52 4 4 4 4 4 4 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 247 34 0 0 0 175 201 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 232 89 0 0 0 0 0 0 0 0 0 0 175 125
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0
0 0 0 0 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 201 0 0 89 251 89 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 201 0 0 0 0 0 0 0 0 0 0 12 232 89
@@ -141,15 +141,15 @@ P2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 232 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0
0 0 0 0 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 4 4 0 0 0 0 0 127 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 201 0 0 201 201 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 127 127 0 127 127 127
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 0 0 0 0 0 127 127 127 0 127 127 127
127 0 127 127 127 127 127 0 127 127 127 127 127 127 127 127 127 0 127 127
127 127 127 127 127 0 127 127 127 127 127 127 127 127 127 127 127 127 127
0 127 127 127 127 127 127 127 127 0 127 127 0 127 127 127 127 0 127 127
@@ -161,8 +161,8 @@ P2
127 127 127 0 127 127 127 127 127 127 127 0 127 127 127 127 127 127 127
0 127 127 127 0 127 127 127 127 127 0 127 127 127 127 127 127 127 127 127
0 127 127 127 127 127 127 127 127 0 127 127 127 127 127 127 127 127 127
0 127 127 127 127 127 127 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0
0 127 127 127 127 127 127 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
@@ -360,102 +360,102 @@ P2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 255 251 89 0 7 206 125 0 89 255 251 89
0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 255 255 255 255 255 255 255 255 255 255
125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 7 206 125 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 175 201 0 0 0 0 0 0
0 0 0 12 12 235 125 0 0 0 0 0 59 245 102 0 89 247 34 12 235 125 0 0 0 0
0 12 235 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235 125 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4 4 4 84 84 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 7 206
125 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138
225 21 0 0 0 0 0 0 0 0 0 175 201 0 0 0 0 0 0 0 0 0 12 12 235 125 0 0 0
0 0 59 245 102 0 89 247 34 12 235 125 0 0 0 0 0 12 235 125 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 7 206 125 0 0 0 138 225 21 0
0 0 0 0 0 0 0 0 0 0 0 0 89 201 0 0 0 0 0 0 0 0 175 125 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138
225 21 0 0 0 0 0 0 0 12 0 235 125 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0
0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 247 34
0 0 0 7 206 125 0 0 0 59 238 34 0 0 0 0 0 0 0 0 0 0 0 0 0 89 201 0 0 0
0 0 0 0 0 175 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 12 235 255 255 255 166 0 12
235 166 245 255 247 34 0 0 12 235 255 255 247 34 0 34 235 255 255 255 225
21 0 12 235 255 255 225 29 0 206 255 255 255 127 0 12 235 255 255 255 225
21 12 235 138 235 255 247 34 0 12 235 102 175 255 247 34 12 235 125 0 59
245 201 0 12 235 125 12 0 235 166 245 255 225 29 206 255 251 89 0 12 235
138 235 255 247 34 0 0 12 235 255 255 201 0 0 12 235 166 245 255 251 89
0 0 12 235 255 255 255 225 21 12 235 138 235 247 127 34 138 255 255 255
206 0 206 255 255 255 201 59 241 89 0 0 89 247 42 206 201 0 0 0 138 225
187 201 0 0 138 225 21 0 59 241 187 226 247 34 0 7 206 206 206 201 0 0
0 138 225 151 255 255 255 255 247 0 0 89 247 34 0 0 0 7 206 125 0 0 0 59
238 34 0 0 0 0 0 0 0 0 0 0 0 0 0 89 201 0 0 0 0 0 0 0 0 175 125 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
0 0 0 0 0 0 0 0 12 206 21 0 59 245 125 12 235 247 34 0 138 225 21 12 235
166 0 0 134 102 0 235 166 0 0 138 225 21 12 235 125 0 0 175 201 12 0 235
125 0 0 12 235 166 0 0 138 225 21 12 235 247 34 0 175 201 0 12 235 102
0 89 247 34 12 235 125 12 235 166 0 0 12 235 125 12 0 235 225 21 12 235
251 89 0 175 201 0 12 235 247 34 0 175 201 0 12 235 166 0 7 206 201 0 12
235 225 21 0 175 225 21 12 235 166 0 0 138 225 21 12 235 247 34 0 0 89
247 34 0 12 206 34 0 235 125 0 0 59 241 89 0 0 89 247 34 89 247 34 0 7
206 166 138 225 21 7 206 251 89 0 89 225 138 34 235 201 0 138 225 21 89
247 34 0 7 206 166 0 0 0 7 206 166 0 0 89 225 21 0 0 0 7 206 125 0 0 0
59 241 89 0 0 0 0 138 251 89 0 0 7 202 89 0 89 201 0 0 0 0 0 0 0 0 175
59 241 89 0 0 0 7 206 125 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4 4 4 4 4 4 4 4 100 252 252 84 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12
235 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 12 0
235 125 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 0 0 12 235 125
0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235
125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 7 206 102 12 235 125 0 0 59 241 89
138 225 21 0 0 0 34 89 225 21 0 0 138 225 21 89 225 21 0 0 89 247 47 0
235 125 0 0 89 225 21 0 0 138 225 21 12 235 125 0 0 89 247 34 12 235 102
0 89 247 34 12 235 138 235 166 0 0 0 12 235 125 12 0 235 125 0 7 206 166
0 0 138 225 21 12 235 125 0 0 89 247 34 138 225 21 0 0 59 238 34 12 235
125 0 0 59 241 89 89 225 21 0 0 138 225 21 12 235 125 0 0 0 138 225 21
0 0 0 12 0 235 125 0 0 59 241 89 0 0 89 247 34 12 235 125 0 59 241 89 59
238 34 12 228 198 166 0 175 166 59 0 89 251 132 241 89 0 12 235 125 0 59
238 34 0 0 0 138 225 21 0 12 235 166 0 0 0 0 7 206 125 0 0 0 0 175 201
0 0 0 138 166 12 235 166 0 12 232 89 0 89 201 0 0 0 0 0 0 0 0 175 125 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 127 0 0 0 0 0 0 0 0 0 59 245 255 255 255 102 12 235 125 0 0 12 235
125 175 201 0 0 0 0 0 175 201 0 0 0 138 225 21 175 255 255 255 255 255
247 47 0 235 125 0 0 175 201 0 0 0 138 225 21 12 235 125 0 0 89 247 34
12 235 102 0 89 247 34 12 235 255 225 21 0 0 0 12 235 125 12 0 235 125
0 7 206 166 0 0 138 225 21 12 235 125 0 0 89 247 34 175 201 0 0 0 12 232
89 12 235 125 0 0 12 235 125 175 201 0 0 0 138 225 21 12 235 125 0 0 0
59 245 255 247 34 0 12 0 235 125 0 0 59 241 89 0 0 89 247 34 0 175 201
0 138 201 0 12 235 125 89 201 89 225 29 206 125 12 0 0 175 255 166 0 0
0 175 201 0 138 201 0 0 0 89 251 89 0 138 247 34 0 0 0 0 0 7 206 125 0
0 0 0 0 89 255 125 7 202 89 0 89 251 89 89 201 0 0 89 201 0 0 0 0 0 0 0
0 175 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 89 255 166 0 7 206 102 12 235 125 0
0 12 235 125 175 201 0 0 0 0 0 175 201 0 0 0 138 225 21 175 201 0 0 0 0
0 12 0 235 125 0 0 175 201 0 0 0 138 225 21 12 235 125 0 0 89 247 34 12
235 102 0 89 247 34 12 235 138 235 201 0 0 0 12 235 125 12 0 235 125 0
7 206 166 0 0 138 225 21 12 235 125 0 0 89 247 34 175 201 0 0 0 12 232
89 12 235 125 0 0 12 235 125 175 201 0 0 0 138 225 21 12 235 125 0 0 0
0 0 138 255 255 201 12 0 235 125 0 0 59 241 89 0 0 89 247 34 0 89 247 42
206 125 0 0 175 166 175 125 12 232 102 232 89 0 0 0 175 255 201 0 0 0 89
247 47 235 125 0 0 12 235 166 0 0 0 12 235 125 0 0 0 0 7 206 125 0 0 0
0 138 201 0 0 12 232 89 0 0 59 245 225 21 0 0 89 201 0 0 0 0 0 0 0 0 175
125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 0 0 0 0 0 0 175 201 0 0 7 206 102 12 235 125 0 0 59 241
89 138 225 21 0 0 0 34 89 225 21 0 0 138 225 21 138 247 34 0 0 0 0 12 0
235 125 0 0 138 225 21 0 0 138 225 21 12 235 125 0 0 89 247 34 12 235 102
0 89 247 34 12 235 125 59 245 125 0 0 12 235 125 12 0 235 125 0 7 206 166
0 0 138 225 21 12 235 125 0 0 89 247 34 138 225 21 0 0 89 247 34 12 235
125 0 0 59 241 89 138 225 21 0 0 138 225 21 12 235 125 0 0 0 0 0 0 0 89
247 47 0 235 125 0 0 59 241 89 0 0 89 247 34 0 12 235 166 238 34 0 0 138
210 228 34 0 175 166 215 21 0 0 89 251 159 251 89 0 0 12 235 191 247 34
0 0 175 225 21 0 0 0 0 138 225 21 0 0 0 7 206 125 0 0 0 12 232 89 0 0 0
0 0 0 0 0 0 0 0 0 0 89 201 0 0 0 0 0 0 0 0 175 125 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0
0 0 0 138 225 21 0 138 255 102 12 235 125 0 7 206 201 0 12 235 166 0 0
134 132 0 245 125 0 59 245 225 21 12 235 201 0 0 12 206 34 0 235 125 0
0 59 245 125 0 12 235 225 21 12 235 125 0 0 89 247 34 12 235 102 0 89 247
34 12 235 125 0 138 251 89 0 12 235 125 12 0 235 125 0 7 206 166 0 0 138
225 21 12 235 125 0 0 89 247 34 12 235 166 0 7 206 201 0 12 235 125 0 7
206 201 0 59 245 125 0 12 235 225 21 12 235 125 0 0 0 138 125 0 0 138 225
29 0 206 166 0 0 7 206 166 0 59 245 247 34 0 0 175 255 201 0 0 0 59 245
225 21 0 89 255 201 0 0 12 235 166 0 175 225 21 0 0 138 255 166 0 0 89
251 89 0 0 0 0 0 89 247 34 0 0 0 7 206 125 0 0 0 59 238 34 0 0 0 0 0 0
0 0 0 0 0 0 0 89 201 0 0 0 0 0 0 0 0 175 125 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 247 34 0 0 0 7 206 125 0 0 0 59 238
34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4 20 236 252 164 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0
0 0 0 0 0 0 0 12 235 255 255 255 166 0 12 235 166 245 255 247 34 0 0 12
235 255 255 247 34 0 34 235 255 255 255 225 21 0 12 235 255 255 225 29
0 206 255 255 255 127 0 12 235 255 255 255 225 21 12 235 138 235 255 247
34 0 12 235 102 175 255 247 34 12 235 125 0 59 245 201 0 12 235 125 12
0 235 166 245 255 225 29 206 255 251 89 0 12 235 138 235 255 247 34 0 0
12 235 255 255 201 0 0 12 235 166 245 255 251 89 0 0 12 235 255 255 255
225 21 12 235 138 235 247 127 34 138 255 255 255 206 0 206 255 255 255
201 59 241 89 0 0 89 247 42 206 201 0 0 0 138 225 187 201 0 0 138 225 21
0 59 241 187 226 247 34 0 7 206 206 206 201 0 0 0 138 225 151 255 255 255
255 247 0 0 89 247 34 0 0 0 7 206 125 0 0 0 59 238 34 0 0 0 0 0 0 0 0 0
0 0 0 0 0 4 4 4 4 4 4 4 148 252 236 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 12 206
21 0 59 245 125 12 235 247 34 0 138 225 21 12 235 166 0 0 134 102 0 235
166 0 0 138 225 21 12 235 125 0 0 175 201 12 0 235 125 0 0 12 235 166 0
0 138 225 21 12 235 247 34 0 175 201 0 12 235 102 0 89 247 34 12 235 125
12 235 166 0 0 12 235 125 12 0 235 225 21 12 235 251 89 0 175 201 0 12
235 247 34 0 175 201 0 12 235 166 0 7 206 201 0 12 235 225 21 0 175 225
21 12 235 166 0 0 138 225 21 12 235 247 34 0 0 89 247 34 0 12 206 34 0
235 125 0 0 59 241 89 0 0 89 247 34 89 247 34 0 7 206 166 138 225 21 7
206 251 89 0 89 225 138 34 235 201 0 138 225 21 89 247 34 0 7 206 166 0
0 0 7 206 166 0 0 89 225 21 0 0 0 7 206 125 0 0 0 59 241 89 0 0 0 0 138
251 89 0 0 7 202 89 0 0 4 4 4 4 4 4 52 252 252 108 4 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0
0 0 0 0 0 0 0 0 7 206 102 12 235 125 0 0 59 241 89 138 225 21 0 0 0 34
89 225 21 0 0 138 225 21 89 225 21 0 0 89 247 47 0 235 125 0 0 89 225 21
0 0 138 225 21 12 235 125 0 0 89 247 34 12 235 102 0 89 247 34 12 235 138
235 166 0 0 0 12 235 125 12 0 235 125 0 7 206 166 0 0 138 225 21 12 235
125 0 0 89 247 34 138 225 21 0 0 59 238 34 12 235 125 0 0 59 241 89 89
225 21 0 0 138 225 21 12 235 125 0 0 0 138 225 21 0 0 0 12 0 235 125 0
0 59 241 89 0 0 89 247 34 12 235 125 0 59 241 89 59 238 34 12 228 198 166
0 175 166 59 0 89 251 132 241 89 0 12 235 125 0 59 238 34 0 0 0 138 225
21 0 12 235 166 0 0 0 0 7 206 125 0 0 0 0 175 201 0 0 0 138 166 12 235
166 0 12 232 89 0 0 12 84 4 4 4 4 204 252 204 4 4 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0
0 0 0 59 245 255 255 255 102 12 235 125 0 0 12 235 125 175 201 0 0 0 0
0 175 201 0 0 0 138 225 21 175 255 255 255 255 255 247 47 0 235 125 0 0
175 201 0 0 0 138 225 21 12 235 125 0 0 89 247 34 12 235 102 0 89 247 34
12 235 255 225 21 0 0 0 12 235 125 12 0 235 125 0 7 206 166 0 0 138 225
21 12 235 125 0 0 89 247 34 175 201 0 0 0 12 232 89 12 235 125 0 0 12 235
125 175 201 0 0 0 138 225 21 12 235 125 0 0 0 59 245 255 247 34 0 12 0
235 125 0 0 59 241 89 0 0 89 247 34 0 175 201 0 138 201 0 12 235 125 89
201 89 225 29 206 125 12 0 0 175 255 166 0 0 0 175 201 0 138 201 0 0 0
89 251 89 0 138 247 34 0 0 0 0 0 7 206 125 0 0 0 0 0 89 255 125 7 202 89
0 89 251 89 89 201 0 0 0 172 252 84 4 4 100 252 252 60 4 4 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0
0 0 0 0 0 0 0 89 255 166 0 7 206 102 12 235 125 0 0 12 235 125 175 201
0 0 0 0 0 175 201 0 0 0 138 225 21 175 201 0 0 0 0 0 12 0 235 125 0 0 175
201 0 0 0 138 225 21 12 235 125 0 0 89 247 34 12 235 102 0 89 247 34 12
235 138 235 201 0 0 0 12 235 125 12 0 235 125 0 7 206 166 0 0 138 225 21
12 235 125 0 0 89 247 34 175 201 0 0 0 12 232 89 12 235 125 0 0 12 235
125 175 201 0 0 0 138 225 21 12 235 125 0 0 0 0 0 138 255 255 201 12 0
235 125 0 0 59 241 89 0 0 89 247 34 0 89 247 42 206 125 0 0 175 166 175
125 12 232 102 232 89 0 0 0 175 255 201 0 0 0 89 247 47 235 125 0 0 12
235 166 0 0 0 12 235 125 0 0 0 0 7 206 125 0 0 0 0 138 201 0 0 12 232 89
0 0 59 245 225 21 0 0 0 196 252 244 60 20 236 252 156 4 4 4 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0
0 0 0 0 0 0 0 175 201 0 0 7 206 102 12 235 125 0 0 59 241 89 138 225 21
0 0 0 34 89 225 21 0 0 138 225 21 138 247 34 0 0 0 0 12 0 235 125 0 0 138
225 21 0 0 138 225 21 12 235 125 0 0 89 247 34 12 235 102 0 89 247 34 12
235 125 59 245 125 0 0 12 235 125 12 0 235 125 0 7 206 166 0 0 138 225
21 12 235 125 0 0 89 247 34 138 225 21 0 0 89 247 34 12 235 125 0 0 59
241 89 138 225 21 0 0 138 225 21 12 235 125 0 0 0 0 0 0 0 89 247 47 0 235
125 0 0 59 241 89 0 0 89 247 34 0 12 235 166 238 34 0 0 138 210 228 34
0 175 166 215 21 0 0 89 251 159 251 89 0 0 12 235 191 247 34 0 0 175 225
21 0 0 0 0 138 225 21 0 0 0 7 206 125 0 0 0 12 232 89 0 0 0 0 0 0 0 0 0
0 0 0 0 0 20 220 252 236 180 252 244 28 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0
138 225 21 0 138 255 102 12 235 125 0 7 206 201 0 12 235 166 0 0 134 132
0 245 125 0 59 245 225 21 12 235 201 0 0 12 206 34 0 235 125 0 0 59 245
125 0 12 235 225 21 12 235 125 0 0 89 247 34 12 235 102 0 89 247 34 12
235 125 0 138 251 89 0 12 235 125 12 0 235 125 0 7 206 166 0 0 138 225
21 12 235 125 0 0 89 247 34 12 235 166 0 7 206 201 0 12 235 125 0 7 206
201 0 59 245 125 0 12 235 225 21 12 235 125 0 0 0 138 125 0 0 138 225 29
0 206 166 0 0 7 206 166 0 59 245 247 34 0 0 175 255 201 0 0 0 59 245 225
21 0 89 255 201 0 0 12 235 166 0 175 225 21 0 0 138 255 166 0 0 89 251
89 0 0 0 0 0 89 247 34 0 0 0 7 206 125 0 0 0 59 238 34 0 0 0 0 0 0 0 0
0 0 0 0 0 0 4 36 236 252 252 252 108 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0
7 206 255 255 171 206 102 12 232 226 255 255 225 21 0 0 12 235 255 255
247 34 0 89 255 255 247 163 225 21 0 7 206 255 255 247 34 12 0 235 125
@@ -466,62 +466,62 @@ P2
255 247 34 0 0 89 255 255 127 0 59 245 255 225 111 247 34 0 0 59 245 125
0 0 0 12 235 166 0 0 59 245 125 7 0 206 225 21 0 12 235 201 0 0 59 241
89 0 0 175 255 255 255 255 247 0 0 89 247 34 0 0 0 7 206 125 0 0 0 59 238
34 0 0 0 0 0 0 0 0 0 0 0 0 0 89 255 255 255 255 255 255 255 255 255 255
125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 201 0 0 0 0 0
0 0 0 0 0 0 0 0 89 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 138 225
21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 89
247 34 0 0 0 7 206 125 0 0 0 59 238 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 60 252 252 204 4 4 4 4 4 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 199 34 0 12
232 89 0 0 0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0
0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 166 0 0 0
0 0 0 0 0 0 0 0 12 235 125 0 0 0 7 206 125 0 0 0 138 225 21 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 201 0 0 0 0 0 0 0 0 0 0 0 0 0
89 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 89 247 34 0 0 0 7
206 125 0 0 0 59 238 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 76 252 60 4 4
4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 199 34 0 12 232 89 0 0
0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0 0 0 0
0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 166 0 0 0 0 0 0 0 0
0 0 0 12 235 125 0 0 0 7 206 125 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 76 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 12 235 255 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 255 251 89 0 0 0 0
12 235 255 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 255 251 89 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235
125 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89
247 34 0 0 0 0 0 0 0 0 0 0 0 0 89 255 251 89 0 7 206 125 0 89 255 247 34
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 12 235 125 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 89 247 34 0 0 0 0 0 0 0 0 0 0 0 0 89 255 251 89 0 7 206 125 0 89 255
247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
127 127 127 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127
127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 127 127 0 127 127
127 127 127 127 127 0 127 127 127 127 0 127 127 127 127 127 127 127 0 127
127 127 127 127 127 127 0 127 127 0 127 127 127 0 127 127 127 127 127 127
127 0 127 127 127 0 127 127 127 127 127 127 127 127 127 127 127 0 127 127
127 127 127 127 127 0 127 127 127 127 127 127 127 0 127 127 127 127 127
127 127 0 127 127 127 127 127 127 127 0 127 127 127 127 127 0 127 127 127
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 127 127
127 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 127 127
0 127 127 127 127 127 127 0 127 127 127 127 127 127 127 0 127 127 127 127
127 127 127 0 127 127 127 127 0 127 127 127 127 127 127 127 0 127 127 127
127 127 127 0 127 127 127 127 127 127 127 127 127 127 0 127 127 127 127
127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 0 127 127 127 127
127 127 127 0 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127
127 127 127 127 127 0 127 127 127 127 127 127 127 127 127 127 127 127 0
127 127 127 127 0 127 127 0 127 127 127 0 127 127 127 127 127 127 127 0
127 127 127 0 127 127 127 127 127 127 127 127 127 127 127 0 127 127 127
127 127 127 127 0 127 127 127 127 127 127 127 0 127 127 127 127 127 127
127 0 127 127 127 127 127 127 127 0 127 127 127 127 127 0 127 127 127 127
127 127 0 127 127 127 127 0 127 127 127 127 127 127 127 0 127 127 127 127
127 127 0 127 127 127 127 127 127 127 127 127 127 0 127 127 127 127 127
127 0 127 127 127 127 127 127 0 127 127 127 127 127 0 127 127 127 127 127
127 127 0 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 127
127 127 127 127 0 127 127 127 127 127 127 127 127 127 127 127 127 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 125 0 175 166 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 206 125 0 175
166 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 125 0 175 166 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 206 125 0 175 166
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 245 225 21 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 255 125 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 255 125 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 245 225 21 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 255 125 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 255 125 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 166 0 138 201 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 166 0 138 201 0 7 206 166 12 235
0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 166 0 138 201 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 166 0 138 201 0 7 206 166 12 235
125 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 125 0 0 0 0 0 175 125
0 0 0 0 0 175 171 206 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

View File

@@ -8,23 +8,23 @@ P2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 0
0 0 0 4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0
0 0 4 4 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0
59 241 97 206 166 0 0 0 0 0 0 0 0 0 0 0 0 0 168 34 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 251 89 0 0 89 255 125 89 255 125 0 0 0 0
7 199 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 166
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 225 21 59 238 42
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0
0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 225 21 59 238 42
206 125 0 0 0 0 7 199 34 89 166 0 0 0 0 168 34 0 0 0 175 255 255 166 0
0 7 202 89 0 0 0 0 59 245 255 251 89 0 0 0 59 238 34 0 12 232 89 0 0 89
247 34 0 59 245 206 199 124 255 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
@@ -33,7 +33,7 @@ P2
255 255 251 89 0 0 89 255 255 166 0 89 255 255 255 255 255 201 0 0 59 245
255 255 125 0 0 12 235 255 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 255 255 255 247 34 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0
0 0 0 0 0 127 0 0 0 0 0 138 225 21 59 238 34 175 125 0 0 0 0 59 192 0 172
89 0 0 59 245 255 255 251 89 89 247 34 12 228 34 0 138 166 0 0 0 0 12 235
125 0 175 225 21 0 0 59 238 34 0 138 201 0 0 0 0 175 166 0 0 0 89 255 201
@@ -42,8 +42,8 @@ P2
89 251 89 0 0 59 245 251 89 0 0 59 241 89 0 0 0 0 0 89 247 34 0 0 0 0 0
0 0 7 206 166 0 7 206 125 0 89 247 34 7 206 166 0 138 225 21 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 12 232 89 0 0 0 0 0 0 0 0 0 0 0 175 166 0 0 0 0 0
0 0 89 125 0 0 175 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 225 21 12 206
0 0 89 125 0 0 175 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0
0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 225 21 12 206
21 175 125 0 0 89 255 255 255 255 255 255 166 59 241 89 168 34 138 125
89 225 21 7 202 89 12 228 34 0 0 0 0 12 232 89 0 138 201 0 0 0 12 206 21
7 202 89 0 0 0 0 59 215 21 59 245 206 199 124 255 125 0 0 0 0 7 202 89
@@ -52,8 +52,8 @@ P2
0 0 59 241 89 0 0 0 0 7 206 125 0 0 0 0 0 0 0 0 89 247 34 0 12 232 89 0
12 232 89 59 241 89 0 59 241 89 0 138 247 34 0 0 138 247 34 0 0 0 0 0 12
235 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 138 255 166 0 0 0 0 0 0 0 0 0 138
225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 172
225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 0 0
0 0 4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 172
89 59 192 0 0 59 238 34 168 34 0 0 89 247 34 12 228 34 138 166 0 0 0 0
0 0 138 251 159 247 34 0 0 0 0 0 0 59 238 34 0 0 0 0 7 202 89 0 0 7 199
34 0 0 0 0 0 0 7 202 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 202 89 0 59
@@ -62,7 +62,7 @@ P2
0 0 0 0 7 206 166 0 0 0 175 251 89 138 201 0 59 241 89 0 12 235 125 0 138
247 34 0 0 138 247 34 0 0 0 59 245 247 34 0 0 0 0 7 206 255 255 255 255
255 255 125 0 0 0 0 138 255 201 0 0 0 0 0 0 89 251 89 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0
127 0 0 0 0 0 138 201 0 0 0 0 0 0 0 0 0 12 206 21 138 125 0 0 7 206 255
247 34 0 0 0 175 255 255 166 59 215 21 175 255 255 125 0 0 138 171 206
166 0 175 201 0 0 0 0 89 201 0 0 0 0 0 0 175 125 0 0 0 0 0 0 0 0 12 235
@@ -72,7 +72,7 @@ P2
247 34 0 0 0 89 247 34 0 0 0 89 255 255 255 125 0 12 235 166 0 59 245 125
0 0 0 0 0 0 0 0 0 0 0 175 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 89 251 89 0 0 7 206 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 89 201
0 0 4 4 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 89 201
0 0 0 0 0 0 0 12 235 255 255 255 255 255 225 21 0 0 0 175 255 251 89 0
0 0 0 0 175 125 89 225 21 59 238 34 89 225 21 12 235 166 175 166 0 0 0
0 89 201 0 0 0 0 0 0 175 125 0 0 0 0 0 0 0 0 0 0 0 7 202 89 0 0 0 0 0 0
@@ -81,8 +81,8 @@ P2
0 0 0 0 59 241 89 59 238 34 0 12 235 125 0 0 12 235 125 0 0 0 12 232 89
0 59 245 125 0 89 255 255 232 241 89 0 0 0 0 0 0 0 0 0 0 0 0 59 245 247
34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 255 201 0 0 0 0 7 206 125 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 125 12 206 21
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 0 0 0 0 4
4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 125 12 206 21
0 0 0 0 0 168 34 175 166 0 0 0 0 59 215 21 138 201 0 12 228 34 138 225
21 0 12 235 251 89 0 0 0 0 59 215 21 0 0 0 0 12 232 89 0 0 0 0 0 0 0 0
0 0 0 7 202 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 202 89 0 0 12 232 89 0
@@ -90,8 +90,8 @@ P2
0 59 241 89 0 0 0 0 0 0 59 241 89 12 232 89 0 12 232 89 0 0 138 225 21
0 0 0 59 238 34 0 7 206 166 0 0 0 0 89 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0
0 12 235 247 34 0 0 7 206 255 255 255 255 255 255 125 0 0 138 255 166 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 225 21 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0
0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 138 225 21 0 0 0 0
0 0 0 0 172 89 89 166 0 0 0 89 166 0 168 42 206 125 0 0 0 7 202 89 0 89
225 21 59 238 34 89 251 89 0 0 175 255 201 0 0 0 0 7 202 89 0 0 0 0 59
215 21 0 0 0 0 0 0 0 0 0 0 0 7 202 89 0 0 0 0 138 247 34 0 0 0 0 0 7 206
@@ -100,7 +100,7 @@ P2
0 175 201 0 138 225 21 0 12 235 125 0 0 0 0 12 235 166 0 59 241 89 0 0
0 7 206 166 0 0 138 247 34 0 0 59 245 125 0 0 0 0 0 0 0 12 232 89 0 0 0
0 0 0 0 0 0 0 0 175 166 0 0 0 0 0 0 0 0 7 206 166 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0
127 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 12 206 21 138 125 0 0 0 12 235 255
255 255 166 0 0 0 0 138 201 0 0 0 175 255 255 125 0 0 138 255 255 255 125
12 235 247 0 0 0 0 138 201 0 0 0 0 175 166 0 0 0 0 0 0 0 0 0 0 0 0 0 0
@@ -109,23 +109,23 @@ P2
251 89 0 0 0 0 59 241 89 0 0 12 235 255 255 225 21 0 0 12 235 255 251 89
0 0 175 225 21 0 0 0 0 0 59 245 255 255 125 0 0 89 255 255 166 0 0 0 138
247 34 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 7 206 166 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 7 206 166 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4
0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 168 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 12 232 89 0 0 59 238 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 175 125 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 206 125
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 0 0 0 0 0 0 0 0
4 4 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 168 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89
255 125 89 255 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 201 0 0 0 0
0 0 0 0 0 0 12 228 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 228 34 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0
127 127 127 127 0 127 127 0 127 127 127 127 127 0 127 127 127 127 127 127
127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 127 127 127 127
127 127 127 0 127 127 127 127 127 127 127 127 0 127 127 0 127 127 127 127
@@ -298,7 +298,7 @@ P2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4 4 4 4 4 4 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 127 0 89 255 125 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0
0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 89 255 255 166 0 0 0 0 0
@@ -306,180 +306,180 @@ P2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 255 201 0 12 228
34 0 0 89 255 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 89 255 255 255 255 255 255
255 255 255 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 59 241 89 0 0 0 0 0 0 0 0
0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 12 235
125 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 59 241 89 0 89 251 89 59 241 89
0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0
34 0 0 89 255 247 34 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4 4 4 116 116
4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 127 0 0 59 241 89 0 0 0 0 0 0 0 0 0 59 241 89 0 0
0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 12 235 125 0 0 0 0 0 0
0 0 0 59 241 89 0 0 0 0 59 241 89 0 89 251 89 59 241 89 0 0 0 0 59 241
89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 225
21 0 0 12 228 34 0 0 0 0 138 201 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4
4 4 28 244 252 52 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59
241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 59 241 89 0
0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 59 241
89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 166
0 0 0 12 228 34 0 0 0 0 89 225 21 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4
4 180 252 164 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 7 206 255 255 255
125 0 59 241 194 255 251 89 0 0 7 206 255 255 201 0 12 235 255 255 251
89 0 12 235 255 251 89 7 206 255 255 247 34 0 12 235 255 255 251 89 59
241 194 255 255 125 0 59 241 89 89 255 251 89 59 241 89 0 138 251 89 59
241 89 59 241 159 255 255 125 89 255 255 166 0 59 241 194 255 255 125 0
0 0 12 235 255 247 34 0 59 241 194 255 255 125 0 0 12 235 255 255 251 89
59 241 159 255 201 0 138 255 255 247 34 206 255 255 255 166 59 241 89 0
59 241 97 206 166 0 0 12 235 125 175 201 0 7 206 166 0 7 206 133 206 225
21 0 89 255 255 166 0 0 12 235 125 138 255 255 255 255 166 0 0 138 166
0 0 0 12 228 34 0 0 0 0 89 225 21 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4
76 252 244 20 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 89 247 34
59 245 166 0 138 225 21 7 206 201 0 0 0 7 206 166 0 59 241 89 7 206 125
0 89 225 21 59 241 89 0 0 7 206 166 0 59 241 89 59 245 166 0 89 247 34
59 241 89 0 59 241 89 59 241 89 138 225 21 0 59 241 89 59 245 201 0 89
255 201 0 89 247 34 59 245 166 0 89 247 34 0 7 206 166 0 138 225 21 59
245 166 0 138 247 34 7 206 166 0 59 241 89 59 245 201 0 0 59 238 34 0 130
34 59 241 89 0 0 59 241 89 0 59 241 89 89 247 34 0 89 247 34 138 225 21
12 235 225 21 12 232 89 7 206 166 12 235 125 89 247 34 0 89 247 34 0 0
0 89 247 34 0 0 138 166 0 0 0 12 228 34 0 0 0 0 89 225 21 0 0 7 206 247
34 0 0 89 201 0 0 4 4 68 12 4 4 4 220 252 108 4 4 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
0 0 0 0 0 0 0 0 0 0 0 59 241 89 59 241 89 0 59 241 89 59 241 89 0 0 0 59
241 89 0 59 241 89 59 238 34 0 59 238 34 59 241 89 0 0 59 241 89 0 59 241
89 59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 159 201 0 0 0 59
241 89 59 241 89 0 59 241 89 0 59 241 89 59 241 89 0 59 241 89 0 59 241
89 0 59 241 89 59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 89 0
0 59 241 89 0 0 0 59 241 89 0 0 59 241 89 0 59 241 89 12 235 125 0 175
166 0 59 238 34 89 171 202 89 89 225 21 0 59 241 226 201 0 12 235 125 0
175 166 0 0 0 12 235 125 0 0 59 238 34 0 0 0 12 228 34 0 0 0 0 7 206 125
0 7 202 89 12 235 166 0 175 125 0 0 4 60 244 172 4 4 132 252 212 4 4 4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 89 225 21 0 0 12 228 34 0 0 0 0 138 201 0 0 0 0 0 0 0 0 0 0 0 0
0 89 166 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0
0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0
0 0 59 241 89 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 59 241
89 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 89 255 255 255 251 89 59 241 89
0 59 241 89 59 238 34 0 0 0 59 238 34 0 59 241 89 59 245 255 255 255 251
0 59 241 89 0 0 59 238 34 0 59 241 89 59 241 89 0 59 241 89 59 241 89 0
59 241 89 59 245 255 225 21 0 0 59 241 89 59 241 89 0 59 241 89 0 59 241
89 59 241 89 0 59 241 89 0 59 238 34 0 12 232 89 59 241 89 0 12 232 89
59 238 34 0 59 241 89 59 241 89 0 0 0 175 255 255 201 0 59 241 89 0 0 59
241 89 0 59 241 89 0 175 201 12 232 89 0 7 206 125 172 89 138 166 138 201
0 0 0 138 247 34 0 0 175 201 12 232 89 0 0 7 206 166 0 0 175 225 21 0 0
0 0 12 228 34 0 0 0 0 0 0 175 225 34 206 21 0 0 175 255 166 0 0 0 4 52
244 252 140 36 244 252 60 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 59
241 89 0 59 241 89 59 241 89 0 59 238 34 59 241 89 0 0 0 59 241 89 0 59
241 89 59 238 34 0 0 0 0 59 241 89 0 0 59 241 89 0 59 241 89 59 241 89
0 59 241 89 59 241 89 0 59 241 89 59 241 97 206 201 0 0 59 241 89 59 241
89 0 59 241 89 0 59 241 89 59 241 89 0 59 241 89 0 59 241 89 0 59 241 89
59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 89 0 0 0 0 0 59 245
125 59 241 89 0 0 59 241 89 0 59 241 89 0 59 238 124 225 21 0 0 175 176
206 21 59 215 187 125 0 0 59 245 255 201 0 0 89 247 124 225 21 0 0 138
225 21 0 0 0 59 241 89 0 0 0 12 228 34 0 0 0 0 12 235 125 0 0 0 0 0 0 0
0 0 0 0 0 4 4 76 252 252 220 252 164 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0
0 0 0 0 0 0 89 247 34 0 89 251 89 59 241 89 0 175 201 0 7 206 201 0 0 0
7 206 166 0 138 251 89 7 206 166 0 7 199 34 59 241 89 0 0 7 206 166 0 138
251 89 59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 89 12 235 166
0 59 241 89 59 241 89 0 59 241 89 0 59 241 89 59 241 89 0 59 241 89 0 7
206 166 0 138 225 21 59 241 89 0 138 225 21 7 206 166 0 89 251 89 59 241
89 0 0 89 125 0 12 232 89 12 232 89 0 12 12 235 125 0 175 251 89 0 7 206
255 125 0 0 0 89 255 201 0 7 206 247 34 0 7 206 166 59 245 125 0 7 206
255 125 0 0 59 241 89 0 0 0 0 0 138 166 0 0 0 12 228 34 0 0 0 0 89 225
21 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 100 252 252 244 28 4 4 4 4 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 138 166 0 0 0 12 228 34 0 0 0 0 89 225 21 0 0 0 0 0 0 0 0 0
0 0 0 89 166 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0
0 0 7 206 255 255 255 125 0 59 241 194 255 251 89 0 0 7 206 255 255 201
0 12 235 255 255 251 89 0 12 235 255 251 89 7 206 255 255 247 34 0 12 235
255 255 251 89 59 241 194 255 255 125 0 59 241 89 89 255 251 89 59 241
89 0 138 251 89 59 241 89 59 241 159 255 255 125 89 255 255 166 0 59 241
194 255 255 125 0 0 0 12 235 255 247 34 0 59 241 194 255 255 125 0 0 12
235 255 255 251 89 59 241 159 255 201 0 138 255 255 247 34 206 255 255
255 166 59 241 89 0 59 241 97 206 166 0 0 12 235 125 175 201 0 7 206 166
0 7 206 133 206 225 21 0 89 255 255 166 0 0 12 235 125 138 255 255 255
255 166 0 0 138 166 0 0 0 12 228 34 0 0 0 0 89 225 21 0 0 0 0 0 0 0 0 0
0 0 0 89 166 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0
0 0 0 0 0 0 89 247 34 59 245 166 0 138 225 21 7 206 201 0 0 0 7 206 166
0 59 241 89 7 206 125 0 89 225 21 59 241 89 0 0 7 206 166 0 59 241 89 59
245 166 0 89 247 34 59 241 89 0 59 241 89 59 241 89 138 225 21 0 59 241
89 59 245 201 0 89 255 201 0 89 247 34 59 245 166 0 89 247 34 0 7 206 166
0 138 225 21 59 245 166 0 138 247 34 7 206 166 0 59 241 89 59 245 201 0
0 59 238 34 0 130 34 59 241 89 0 0 59 241 89 0 59 241 89 89 247 34 0 89
247 34 138 225 21 12 235 225 21 12 232 89 7 206 166 12 235 125 89 247 34
0 89 247 34 0 0 0 89 247 34 0 0 138 166 0 0 0 12 228 34 0 0 0 0 89 225
21 0 0 7 206 247 34 0 0 89 201 0 0 89 166 0 0 0 0 0 0 0 138 125 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 59 241 89 59 241 89 0 59 241 89
59 241 89 0 0 0 59 241 89 0 59 241 89 59 238 34 0 59 238 34 59 241 89 0
0 59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 89 0 59 241 89 59
241 159 201 0 0 0 59 241 89 59 241 89 0 59 241 89 0 59 241 89 59 241 89
0 59 241 89 0 59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 89 0 59
241 89 59 241 89 0 0 59 241 89 0 0 0 59 241 89 0 0 59 241 89 0 59 241 89
12 235 125 0 175 166 0 59 238 34 89 171 202 89 89 225 21 0 59 241 226 201
0 12 235 125 0 175 166 0 0 0 12 235 125 0 0 59 238 34 0 0 0 12 228 34 0
0 0 0 7 206 125 0 7 202 89 12 235 166 0 175 125 0 0 89 166 0 0 0 0 0 0
0 138 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 89 255 255 255 251
89 59 241 89 0 59 241 89 59 238 34 0 0 0 59 238 34 0 59 241 89 59 245 255
255 255 251 0 59 241 89 0 0 59 238 34 0 59 241 89 59 241 89 0 59 241 89
59 241 89 0 59 241 89 59 245 255 225 21 0 0 59 241 89 59 241 89 0 59 241
89 0 59 241 89 59 241 89 0 59 241 89 0 59 238 34 0 12 232 89 59 241 89
0 12 232 89 59 238 34 0 59 241 89 59 241 89 0 0 0 175 255 255 201 0 59
241 89 0 0 59 241 89 0 59 241 89 0 175 201 12 232 89 0 7 206 125 172 89
138 166 138 201 0 0 0 138 247 34 0 0 175 201 12 232 89 0 0 7 206 166 0
0 175 225 21 0 0 0 0 12 228 34 0 0 0 0 0 0 175 225 34 206 21 0 0 175 255
166 0 0 0 89 166 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0
0 0 0 0 59 241 89 0 59 241 89 59 241 89 0 59 238 34 59 241 89 0 0 0 59
241 89 0 59 241 89 59 238 34 0 0 0 0 59 241 89 0 0 59 241 89 0 59 241 89
59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 97 206 201 0 0 59 241
89 59 241 89 0 59 241 89 0 59 241 89 59 241 89 0 59 241 89 0 59 241 89
0 59 241 89 59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 89 0 0 0
0 0 59 245 125 59 241 89 0 0 59 241 89 0 59 241 89 0 59 238 124 225 21
0 0 175 176 206 21 59 215 187 125 0 0 59 245 255 201 0 0 89 247 124 225
21 0 0 138 225 21 0 0 0 59 241 89 0 0 0 12 228 34 0 0 0 0 12 235 125 0
0 0 0 0 0 0 0 0 0 0 0 89 166 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 127 0 0 0 0 0 0 0 89 247 34 0 89 251 89 59 241 89 0 175 201 0 7 206 201
0 0 0 7 206 166 0 138 251 89 7 206 166 0 7 199 34 59 241 89 0 0 7 206 166
0 138 251 89 59 241 89 0 59 241 89 59 241 89 0 59 241 89 59 241 89 12 235
166 0 59 241 89 59 241 89 0 59 241 89 0 59 241 89 59 241 89 0 59 241 89
0 7 206 166 0 138 225 21 59 241 89 0 138 225 21 7 206 166 0 89 251 89 59
241 89 0 0 89 125 0 12 232 89 12 232 89 0 12 12 235 125 0 175 251 89 0
7 206 255 125 0 0 0 89 255 201 0 7 206 247 34 0 7 206 166 59 245 125 0
7 206 255 125 0 0 59 241 89 0 0 0 0 0 138 166 0 0 0 12 228 34 0 0 0 0 89
225 21 0 0 0 0 0 0 0 0 0 0 0 0 89 166 0 0 0 0 0 0 0 138 125 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 0 0 0 0 0 0 175 255 255 232 241 89 59 245 255 255 247
34 0 0 12 235 255 255 201 0 59 245 255 200 241 89 0 12 235 255 251 89 0
59 241 89 0 0 0 12 235 255 200 241 89 59 241 89 0 59 241 89 59 241 89 0
59 241 89 59 241 89 0 59 245 201 59 241 89 59 241 89 0 59 241 89 0 59 241
0 0 0 0 127 0 0 0 0 0 0 0 0 175 255 255 232 241 89 59 245 255 255 247 34
0 0 12 235 255 255 201 0 59 245 255 200 241 89 0 12 235 255 251 89 0 59
241 89 0 0 0 12 235 255 200 241 89 59 241 89 0 59 241 89 59 241 89 0 59
241 89 59 241 89 0 59 245 201 59 241 89 59 241 89 0 59 241 89 0 59 241
89 59 241 89 0 59 241 89 0 0 12 235 255 247 34 0 59 245 166 255 247 34
0 0 59 245 255 166 241 89 59 241 89 0 0 59 245 255 255 166 0 0 138 255
255 125 0 89 255 255 166 241 89 0 0 138 247 34 0 0 0 59 245 125 0 0 138
225 21 7 206 225 21 0 138 251 0 0 138 247 34 0 0 175 255 255 255 255 166
0 0 138 166 0 0 0 12 228 34 0 0 0 0 89 225 21 0 0 0 0 0 0 0 0 0 0 0 0 89
255 255 255 255 255 255 255 255 255 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 138 166 0 0 0 12 228 34 0 0 0 0 89 225 21 0 0 0 0 0 0 0 0 0 0 0 0 4
4 4 4 132 252 108 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 89 247 34 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0
0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 232 89 0 0 0 0 0 0 0 0 0 0 0 138
201 0 0 0 12 228 34 0 0 0 0 138 201 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4
116 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 166 255 255
247 34 0 0 0 0 0 0 0 0 0 0 0 255 255 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 59
241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 7 206 255
201 0 12 228 34 0 0 89 255 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4
4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 127 127 127 127 127 0 127 127 127
127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 0 127 127 127
127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 0 127 127 127 127
127 127 0 127 127 127 127 127 127 0 127 127 0 127 127 127 0 127 127 127
127 127 127 0 127 127 0 127 127 127 127 127 127 127 127 127 127 0 127 127
127 127 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 127
0 127 127 127 127 127 127 0 127 127 127 127 0 127 127 127 127 127 0 127
127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 127 0 127 127
127 127 127 127 127 127 127 0 127 127 127 127 127 0 127 127 127 127 127
127 0 127 127 127 127 127 0 127 127 127 127 127 127 0 127 127 127 0 127
127 127 127 127 127 127 0 127 127 127 127 127 127 127 127 0 127 127 127
127 127 127 127 127 127 127 127 127 127 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0 0 0 0 0 89 247 34 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241
89 0 0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 232 89 0 0 0 0 0
0 0 0 0 0 0 138 201 0 0 0 12 228 34 0 0 0 0 138 201 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 166 255 255 247 34 0 0 0 0 0 0 0 0 0 0 0 255 255 125 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 241 89 0
0 0 0 0 0 0 0 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 225 21 0 0 0 0 0 0 0
0 0 0 0 7 206 255 201 0 12 228 34 0 0 89 255 251 89 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 127 127 127 127
127 0 127 127 127 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127
127 0 127 127 127 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127
0 127 127 127 127 127 127 0 127 127 127 127 127 127 0 127 127 0 127 127
127 0 127 127 127 127 127 127 0 127 127 0 127 127 127 127 127 127 127 127
127 127 0 127 127 127 127 127 127 127 0 127 127 127 127 127 127 0 127 127
127 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 0 127 127 127
127 127 0 127 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127
127 0 127 127 127 127 127 127 127 127 127 0 127 127 127 127 127 0 127 127
127 127 127 127 0 127 127 127 127 127 0 127 127 127 127 127 127 0 127 127
127 0 127 127 127 127 127 127 127 0 127 127 127 127 127 127 127 127 0 127
127 127 127 127 127 127 127 127 127 127 127 127 127 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 89 247 34 138 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235 125 59 238 34 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 89 247 34 138 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 235 125 59 238 34 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 255
225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12 235 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
89 255 225 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 12 235 251 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 238 34 138 201 0 0 0 0 0
0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 199 34 0 0 0 0 0 7 199 34 0 0 0 0 138 255
201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 238 34 138 201 0 0
0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 199 34 0 0 0 0 0 7 199 34 0 0 0 0
138 255 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 251 89 0 0 138 255 251 97 206 201
0 0 138 251 102 235 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 89 255 201 12 228 34 0 0 0 0 0 0 0 0 0 0 0 0 7 206 166 12 232 89 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 166 12 235 127
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 175 255 255 255 225 21 59 245 255
255 255 255 255 125 0 0 0 0 0 0 0 7 206 255 247 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 7 199 34 0 0 0 0 0 7 199 34 0 0 0 138 225 21 175 166 0 0 175
255 255 166 0 0 7 202 89 0 0 0 0 0 0 0 0 0 0 59 245 255 255 201 0 0 0 0
0 0 0 0 59 245 255 255 255 255 255 255 255 255 125 0 59 245 255 255 255
255 255 125 0 0 89 255 255 255 255 255 225 21 59 245 255 255 255 255 255
125 0 0 0 59 245 255 255 255 255 255 125 7 206 166 0 0 175 171 206 166
89 247 34 0 175 201 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 12 228 34 175 255 125 0 0 89 255 255 255 125 175 251 89 89 255 125
0 7 206 255 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 245 255 255
255 255 255 125 0 0 7 206 255 125 59 245 125 0 0 0 89 251 89 0 0 0 0 0
0 0 127 7 206 225 21 0 0 0 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 0 175 201
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 245 255 255 255 255 125 0 59 245
255 255 255 255 125 0 0 0 0 0 0 0 89 247 34 12 228 34 0 138 166 0 0 0 0
0 0 0 0 0 0 12 235 125 0 7 176 21 0 0 0 0 0 0 138 251 89 0 0 138 201 0
0 0 0 0 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 7 206 166 0 59 115 0 0 0 0
59 115 0 0 0 59 115 0 0 0 0 59 115 0 89 201 0 12 232 89 89 201 7 202 89
12 232 89 138 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 7 199 34 0 172 132 196 199 163 125 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 0 89 247
34 0 7 206 125 0 0 0 0 0 0 0 0 127 89 247 34 0 0 0 0 0 59 115 0 0 0 0 59
115 0 0 0 0 0 0 7 206 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 199
34 0 0 0 0 0 7 199 34 0 0 0 0 0 0 0 0 0 89 225 21 7 202 89 12 228 34 0
0 0 0 0 0 0 0 0 0 59 238 34 0 0 0 0 0 0 0 130 34 59 241 89 0 0 0 138 201
0 0 0 0 0 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 175 225 21 0 59 115 0 0 0
0 59 115 0 0 0 59 115 0 0 0 0 59 115 0 12 228 34 59 192 0 12 228 34 138
166 59 215 21 175 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 7 199 34 0 172 89 175 166 138 125 0 138 255 255 247 34
12 146 0 0 0 0 89 255 255 255 125 12 235 255 255 125 0 0 0 59 115 0 0 0
0 59 115 0 138 255 255 255 255 127 0 175 201 0 138 225 21 0 0 0 0 0 0 0
0 127 245 255 255 255 255 255 125 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 12
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 251 89 0 0 138 255 251 97 206 201 0 0 138
251 102 235 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 255
201 12 228 34 0 0 0 0 0 0 0 0 0 0 0 0 7 206 166 12 232 89 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 175 166 12 235 127 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 127 0 0 175 255 255 255 225 21 59 245 255 255 255
255 255 125 0 0 0 0 0 0 0 7 206 255 247 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 7 199 34 0 0 0 0 0 7 199 34 0 0 0 138 225 21 175 166 0 0 175 255 255
166 0 0 7 202 89 0 0 0 0 0 0 0 0 0 0 59 245 255 255 201 0 0 0 0 0 0 0 0
59 245 255 255 255 255 255 255 255 255 125 0 59 245 255 255 255 255 255
125 0 0 89 255 255 255 255 255 225 21 59 245 255 255 255 255 255 125 0
0 0 59 245 255 255 255 255 255 125 7 206 166 0 0 175 171 206 166 89 247
34 0 175 201 59 241 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12 228 34 175 255 125 0 0 89 255 255 255 125 175 251 89 89 255 125 0 7
206 255 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 245 255 255 255
255 255 125 0 0 7 206 255 125 59 245 125 0 0 0 89 251 89 0 0 0 0 0 0 0
127 7 206 225 21 0 0 0 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 0 175 201 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 245 255 255 255 255 125 0 59 245 255
255 255 255 125 0 0 0 0 0 0 0 89 247 34 12 228 34 0 138 166 0 0 0 0 0 0
0 0 0 0 12 235 125 0 7 176 21 0 0 0 0 0 0 138 251 89 0 0 138 201 0 0 0
0 0 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 7 206 166 0 59 115 0 0 0 0 59 115
0 0 0 59 115 0 0 0 0 59 115 0 89 201 0 12 232 89 89 201 7 202 89 12 232
89 138 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 7 199 34 0 172 132 196 199 163 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 0 89 247 34 0 7
206 125 0 0 0 0 0 0 0 0 127 89 247 34 0 0 0 0 0 59 115 0 0 0 0 59 115 0
0 0 0 0 0 7 206 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 199 34 0
0 0 0 0 7 199 34 0 0 0 0 0 0 0 0 0 89 225 21 7 202 89 12 228 34 0 0 0 0
0 0 0 0 0 0 59 238 34 0 0 0 0 0 0 0 130 34 59 241 89 0 0 0 138 201 0 0
0 0 0 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 175 225 21 0 59 115 0 0 0 0 59
115 0 0 0 59 115 0 0 0 0 59 115 0 12 228 34 59 192 0 12 228 34 138 166
59 215 21 175 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 7 199 34 0 172 89 175 166 138 125 0 138 255 255 247 34 12
146 0 0 0 0 89 255 255 255 125 12 235 255 255 125 0 0 0 59 115 0 0 0 0
59 115 0 138 255 255 255 255 127 0 175 201 0 138 225 21 0 0 0 0 0 0 0 0
127 245 255 255 255 255 255 125 0 59 115 0 0 0 0 59 115 0 0 0 0 0 0 12
232 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 199 34 0 0 0 0 0 7 199
34 0 0 0 0 0 0 0 0 0 89 247 34 12 228 34 138 166 0 0 0 0 0 0 0 0 0 0 0
12 235 166 0 0 0 0 0 0 175 225 21 138 225 21 0 0 0 138 201 0 0 0 0 0 0

View File

@@ -188,301 +188,301 @@ P2
0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0
255 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 255
255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 0
0 0 0 255 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255
0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 4 4
4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0
0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 0 0 0 0 255 0
0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0
0 0 0 0 4 4 4 4 12 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 127 0 0 0 0 0 255 255 0 0 255 255 255 0 0 0 255 255 0 0 255
255 255 0 0 255 255 0 0 255 255 255 0 255 255 255 0 255 255 255 0 0 255
0 255 255 0 255 0 0 255 0 255 0 255 255 255 0 255 255 0 0 255 255 255 0
0 0 255 255 0 0 255 255 255 0 0 0 255 255 255 0 255 0 255 255 255 255 0
255 255 0 255 0 0 255 0 255 0 0 0 255 0 255 0 0 255 0 0 255 0 255 0 255
0 255 0 0 0 255 0 255 255 255 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0
0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
0 0 0 0 0 0 0 255 0 255 0 0 255 0 255 0 0 0 255 0 0 255 0 255 0 0 255 0
255 0 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 0 255 0 0 255 0 255
0 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255
0 255 255 0 255 0 0 0 255 0 0 255 0 0 255 0 0 255 0 255 0 0 255 0 0 255
0 0 255 0 0 255 0 0 0 255 0 255 0 0 0 0 255 0 0 255 0 0 0 255 0 0 0 255
0 0 0 255 255 0 0 255 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0
127 0 0 0 0 0 255 255 0 0 255 255 255 0 0 0 255 255 0 0 255 255 255 0 0
255 255 0 0 255 255 255 0 255 255 255 0 255 255 255 0 0 255 0 255 255 0
255 0 0 255 0 255 0 255 255 255 0 255 255 0 0 255 255 255 0 0 0 255 255
0 0 255 255 255 0 0 0 255 255 255 0 255 0 255 255 255 255 0 255 255 0 255
0 0 255 0 255 0 0 0 255 0 255 0 0 255 0 0 255 0 255 0 255 0 255 0 0 0 255
0 255 255 255 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 4 4 4 4 0
255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0
255 0 255 0 0 255 0 255 0 0 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0
0 255 0 255 0 0 255 0 255 0 0 255 0 255 0 255 0 0 255 0 255 0 0 255 0 0
255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 255 0
255 0 0 0 255 0 0 255 0 0 255 0 0 255 0 255 0 0 255 0 0 255 0 0 255 0 0
255 0 0 0 255 0 255 0 0 0 0 255 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 255
0 0 255 0 0 255 4 4 0 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 255 255 255 0 255 0 0 255 0 255 0 0 0 255
0 0 255 0 255 255 255 255 0 255 0 0 255 0 0 255 0 255 0 0 255 0 255 0 0
255 0 255 255 0 0 0 255 0 255 0 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255
0 255 0 0 255 0 255 0 0 255 0 255 0 0 0 255 0 0 255 0 0 255 0 0 255 0 0
255 0 255 0 0 255 0 255 0 255 0 255 0 0 255 0 0 0 255 0 255 0 0 0 255 0
0 255 0 0 0 0 255 0 0 0 0 255 0 255 0 0 255 255 0 0 0 255 0 0 0 0 0 255
0 0 0 127 0 0 0 0 0 255 255 255 0 255 0 0 255 0 255 0 0 0 255 0 0 255 0
255 255 255 255 0 255 0 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255
255 0 0 0 255 0 255 0 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 0
0 255 0 255 0 0 255 0 255 0 0 0 255 0 0 255 0 0 255 0 0 255 0 0 255 0 255
0 0 255 0 255 0 255 0 255 0 0 255 0 0 0 255 0 255 0 0 0 255 0 0 255 0 0
0 0 255 0 0 0 0 255 0 255 0 0 255 255 0 0 0 255 255 4 255 255 0 4 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 255 0 0 255 0
255 0 0 255 0 255 0 0 0 255 0 0 255 0 255 0 0 0 0 255 0 0 255 0 0 255 0
255 0 0 255 0 255 0 0 255 0 255 0 255 0 0 255 0 255 0 0 255 0 0 255 0 255
0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 0 0 255 0 255
0 0 255 0 0 255 0 0 255 0 255 0 0 0 255 255 0 255 255 0 0 0 255 0 0 0 255
0 255 0 0 255 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 255 0
0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0
255 255 255 0 255 255 255 0 0 0 255 255 0 0 255 255 255 0 0 255 255 255
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 255 0 0 255 0 255 0
0 255 0 255 0 0 0 255 0 0 255 0 255 0 0 0 0 255 0 0 255 0 0 255 0 255 0
0 255 0 255 0 0 255 0 255 0 255 0 0 255 0 255 0 0 255 0 0 255 0 255 0 0
255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 0 0 255 0 255 0
0 255 0 0 255 0 0 255 0 255 0 0 0 255 255 0 255 255 0 0 0 255 0 0 0 255
0 255 0 0 255 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255
255 255 0 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0
0 255 255 255 0 255 255 255 0 0 0 255 255 0 0 255 255 255 0 0 255 255 255
0 255 0 0 0 255 255 255 0 255 0 0 255 0 255 0 0 255 0 255 0 0 255 0 255
0 255 0 0 255 0 0 255 0 255 0 0 255 0 0 255 255 0 0 255 255 255 0 0 0 255
255 255 0 255 0 0 255 255 255 0 0 255 0 0 255 255 255 0 0 0 255 0 0 0 0
255 0 0 0 255 0 0 255 0 255 0 0 0 255 0 0 0 255 255 255 0 0 255 0 0 0 255
0 0 0 255 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 255 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0
0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 0 0 0 0 0 0 0 0 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 255 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255
0 0 0 0 0 0 0 0 0 0 255 0 0 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 127 127 0 127 127
127 127 0 127 127 127 127 0 127 127 127 0 127 127 127 127 0 127 127 127
127 0 127 127 0 127 127 127 127 0 127 127 127 127 0 127 0 127 127 0 127
127 127 127 0 127 0 127 127 127 127 127 127 127 0 127 127 127 127 0 127
127 127 127 0 127 127 127 127 0 127 127 127 127 0 127 127 0 127 127 127
0 127 127 0 127 127 127 127 0 127 127 127 127 127 0 127 127 127 127 127
127 127 0 127 127 127 0 127 127 127 127 127 0 127 127 127 0 127 127 127
0 127 127 127 0 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127
127 127 127 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0
0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 255 0 0 255 255 0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 255 255 0 255 0 0 0 0 0 0 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 127 0 255 255 255 0 0 255 255 255 255 255 255 255 0 0 0 0
0 0 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 255 0 255
0 0 255 255 0 0 0 255 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 0 255 255 255
255 255 255 255 0 0 255 255 255 255 255 255 255 0 255 255 255 255 0 0 255
255 255 255 255 255 255 0 0 255 255 255 255 255 255 255 0 255 0 0 255 255
0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 255 255
255 255 0 255 0 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255
255 255 255 0 0 255 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 127 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0
0 0 0 0 0 0 0 0 255 255 255 255 255 0 255 255 255 255 255 0 0 0 0 0 0 255
0 0 255 0 255 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 0 0 0
255 0 0 0 0 0 255 0 0 0 0 255 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 0 255
0 0 255 255 0 0 255 0 255 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 255 0 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0
0 0 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 255 255 255 255 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 255 0 0 255 0
255 0 0 0 0 0 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 255 0 0 0 0 0 255 0 0
0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0
0 255 0 255 0 255 255 255 0 255 0 0 0 255 255 0 255 255 0 0 0 255 0 0 0
0 0 255 0 255 255 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 127 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 255 255 255 0 0
0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 255 255 255 255 0 0 0 0 0 0 0 255
255 0 255 0 255 255 0 255 255 0 0 0 255 255 255 0 0 255 0 0 255 0 0 0 255
255 255 255 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 0 0 0 255 0 0
255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 255 0 0 255 0 0
255 0 0 255 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 127 255 255 255 255 0 0 255 0 0 0 0 0 255 0 0 0
0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0
0 0 0 255 0 255 0 0 255 0 0 255 0 0 0 0 0 255 0 255 0 0 255 0 0 0 255 0
0 0 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 0 0 0 255 0 0 255 0 0
0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 0 255 255 255 255 0 255
255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0
255 0 0 255 255 255 255 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 255 0 0 0 0 0 255 0 0 0
0 0 255 0 0 255 0 0 255 0 0 0 255 0 255 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0
255 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 255 0 0 255 0 0 0 0 0 255 0 0 255
0 255 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 0
0 255 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 255 0
0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 255 255 255 0 0 255 255 255 255 255
255 255 0 0 255 0 255 0 0 0 0 255 0 255 0 255 0 255 0 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 255 0 255 255 0 0 255 255 255 255
0 0 0 0 0 0 255 255 255 255 255 255 255 0 0 255 255 255 255 255 255 255
0 255 255 255 255 0 0 255 255 255 255 255 255 255 0 0 255 255 255 255 255
255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 255 255 0 255 255 255 0 0 255
255 255 255 255 255 255 0 255 255 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 255
0 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 255 0 0 0 0 0 0 0 0 0 0 20 0 255 0 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 255
0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 4 0 0 0 4 4 4 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 255 255 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0
0 0 0 0 255 0 0 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 127 127 0 127 127 127 127 0
127 127 127 127 0 127 127 127 0 127 127 127 127 0 127 127 127 127 0 127
127 0 127 127 127 127 0 127 127 127 127 0 127 0 127 127 0 127 127 127 127
0 127 0 127 127 127 127 127 127 127 0 127 127 127 127 0 127 127 127 127
0 127 127 127 127 0 127 127 127 127 0 127 127 0 127 127 127 0 127 127 0
127 127 127 127 0 127 127 127 127 127 0 127 127 127 127 127 127 127 0 127
127 127 0 127 127 127 127 127 0 127 127 127 0 127 127 127 0 127 127 127
0 127 127 127 0 127 127 127 127 127 127 0 127 127 127 127 127 127 127 127
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0
0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0
255 255 0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255
0 255 0 0 0 0 0 0 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
0 255 255 255 0 0 255 255 255 255 255 255 255 0 0 0 0 0 0 255 255 0 0 0
0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 255 0 255 0 0 255 255 0 0
0 255 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 0 255 255 255 255 255 255 255
0 0 255 255 255 255 255 255 255 0 255 255 255 255 0 0 255 255 255 255 255
255 255 0 0 255 255 255 255 255 255 255 0 255 0 0 255 255 0 255 0 0 255
0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 255 255 255 255 0 255
0 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 0
0 255 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0
255 255 255 255 255 0 255 255 255 255 255 0 0 0 0 0 0 255 0 0 255 0 255
0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0
255 0 0 0 0 255 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 0 255 0 0 255 255
0 0 255 0 255 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
255 0 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255
0 0 0 0 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
255 255 255 255 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 255 0 0 255 0 255 0 0 0 0 0
0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0
0 255 0 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255 0 255 0
255 255 255 0 255 0 0 0 255 255 0 255 255 0 0 0 255 0 0 0 0 0 255 0 255
255 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 255 255 255 0 0 0 0 0 0 0 0 0 0
0 0 0 0 255 0 0 0 255 255 255 255 255 0 0 0 0 0 0 0 255 255 0 255 0 255
255 0 255 255 0 0 0 255 255 255 0 0 255 0 0 255 0 0 0 255 255 255 255 0
0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 0
255 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 255 0 0 255 0 0 255 0 0 255 0
0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 255 255 255 255 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255 0 255
0 0 255 0 0 255 0 0 0 0 0 255 0 255 0 0 255 0 0 0 255 0 0 0 0 0 255 0 0
0 0 0 255 0 0 255 0 0 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 255 255 255 0 255 255 255 255 0 255 255 255 255 255
255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 255 0 0 255 255
255 255 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 255
0 0 255 0 0 0 255 0 255 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0
0 0 0 0 0 255 0 255 0 0 255 0 0 255 0 0 0 0 0 255 0 0 255 0 255 0 0 0 255
0 0 0 0 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 255 0
0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 255 0 0 255 0 0 0 0 0
255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 127 0 255 255 255 0 0 255 255 255 255 255 255 255 0 0 255
0 255 0 0 0 0 255 0 255 0 255 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 255 0 0 0 255 255 0 255 255 0 0 255 255 255 255 0 0 0 0 0 0 255
255 255 255 255 255 255 0 0 255 255 255 255 255 255 255 0 255 255 255 255
0 0 255 255 255 255 255 255 255 0 0 255 255 255 255 255 255 255 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 255 255 255 0 0 0 0 0 255 255 0 255 255 255 0 0 255 255 255 255 255
255 255 0 255 255 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 255 0 0 0 255 0 255
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 127 127 127 127 0 127 127 127 127 127 127 127 127
0 127 0 127 127 127 127 0 127 127 127 127 0 127 127 127 127 127 0 127 127
127 127 127 0 127 127 127 127 127 0 127 127 127 127 0 127 127 127 127 127
127 127 127 127 127 127 127 0 127 127 127 127 127 0 127 127 0 127 127 127
127 127 127 127 127 0 127 127 127 127 127 127 127 127 0 127 127 127 127
0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 127 127 127 127 0 127 127 127 127 127 127 127 127 0 127 0 127 127
127 127 0 127 127 127 127 0 127 127 127 127 127 0 127 127 127 127 127 0
127 127 127 127 127 0 127 127 127 127 0 127 127 127 127 127 127 127 127
127 127 127 127 0 127 127 127 127 127 0 127 127 0 127 127 127 127 127 127
127 127 0 127 127 127 127 127 127 127 127 0 127 127 127 127 0 127 127 127
127 127 127 127 127 0 127 127 127 127 127 127 127 127 0 127 0 127 0 127
127 127 0 127 127 127 0 127 127 127 0 127 127 127 127 0 127 127 127 127
127 127 127 0 127 127 127 127 0 127 127 127 127 127 127 127 0 127 127 127
0 127 127 0 127 127 127 127 127 127 127 0 127 127 127 127 127 127 127 127
0 127 127 127 0 127 127 127 127 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 127 0 0 0 0 0 255 0 0 0 255 0 0 0 0 255 255 0 0 0 0 0 0 0 255 0
0 0 255 0 255 0 0 255 255 255 0 0 255 0 255 0 0 0 255 255 255 255 0 0 255
255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 0 0 0
0 255 0 0 0 0 0 0 0 0 0 0 255 255 255 0 255 255 255 0 0 255 0 0 0 0 0 0
0 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255 255 0 0 0 0 0 0 0 0 255
0 0 255 0 0 0 0 0 255 0 0 0 255 0 0 0 255 255 255 0 0 255 0 0 0 0 255 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0
0 255 0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 255 255
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 0 255 0 255
0 0 0 0 255 0 0 0 0 0 0 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255 255 0 255
0 0 0 0 0 0 0 0 0 0 255 255 0 255 0 0 255 0 0 0 0 0 0 255 255 0 255 0 0
0 0 0 255 255 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
127 0 0 0 0 0 255 0 0 255 255 255 0 0 255 0 0 0 0 255 255 255 0 0 0 255
0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 255 0 0 255 255 0 0 255 255 0 255
0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 255 0 255 255 255 0 0 255 0 0 0 0 0
0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 255 0 0 255 0 255
255 0 255 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 255 0 255 0 255 0 0 0 255
0 255 0 0 0 0 0 0 255 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 0 0 0 255 0 255 0 255 0 0 255 255 255 0 0 0 255 0 255
0 0 0 0 255 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0 255 0 255 0 0 0 0 255 0
255 255 0 255 0 255 0 0 0 255 255 255 255 255 0 0 0 0 255 0 255 0 0 255
0 255 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 0 0 255 255 255 0 255 255
0 0 0 0 0 0 255 0 0 255 0 255 255 0 255 0 0 255 0 0 0 0 0 0 0 255 255 255
0 255 255 0 0 0 255 0 255 0 0 255 255 0 0 255 255 0 0 0 255 0 255 0 255
255 0 0 255 255 0 255 0 255 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0
255 0 255 0 255 0 0 0 255 0 0 0 0 255 255 255 0 0 0 255 255 255 0 0 0 0
255 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 0 255 0 0 0 0 255 0 255 0 0 0 0
0 0 0 255 0 255 255 0 255 0 255 255 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0
255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255 0 0 255 0 255 0 0 255 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 0 255 0 255 0 255 0 0 0 0 255
0 0 0 0 255 0 0 0 255 0 255 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0
0 255 0 255 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0
255 255 255 0 0 0 0 0 0 255 0 0 255 255 0 0 255 0 0 0 0 0 255 0 255 0 0
0 0 0 0 255 0 0 0 0 255 0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 127
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255 0 0 255 0 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 0 0 255 0 255 255 255 255 0 0 0 255
0 0 0 255 0 0 0 0 255 0 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0
0 0 0 255 0 0 255 255 255 0 255 255 255 255 0 0 0 0 0 0 0 0 0 255 0 0 0
255 0 0 0 0 255 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255
0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 0 0 255 0 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 255 0 0 0 255 255
255 0 0 255 0 0 0 0 255 0 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0
0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0
0 0 0 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255
255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 127 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255
0 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 255 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 127 127 127 127 0 127 0 127 127 127 127 0 127 127 127
127 0 127 127 127 127 127 0 127 127 127 127 127 0 127 0 127 127 127 127
0 127 127 127 127 0 127 127 127 127 127 127 127 0 127 127 127 0 127 127
127 127 0 127 127 127 127 127 127 0 127 127 0 127 127 127 127 127 127 127
0 127 127 127 127 0 127 127 127 127 0 127 127 127 127 127 0 127 127 127
127 0 127 127 127 0 127 127 127 0 127 127 127 127 0 127 127 127 127 0 127
127 127 0 127 127 127 0 127 127 127 0 127 127 127 127 0 127 127 127 127
0 127 127 127 127 127 127 127 127 0 127 127 127 127 127 127 127 127 0 127
0 127 0 127 127 127 0 127 127 127 0 127 127 127 0 127 127 127 127 0 127
127 127 127 127 127 127 0 127 127 127 127 0 127 127 127 127 127 127 127
0 127 127 127 0 127 127 0 127 127 127 127 127 127 127 0 127 127 127 127
127 127 127 127 0 127 127 127 0 127 127 127 127 127 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
127 127 127 127 127 127 0 127 127 127 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 255 0
0 0 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 255 0 255 255 0 0 0 255 0 0 255
0 0 0 0 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255
0 0 0 0 255 0 255 0 0 0 255 0 255 0 0 0 255 0 0 0 255 0 0 255 0 255 0 255
0 255 0 0 0 0 0 0 0 0 0 255 0 255 255 0 0 0 0 0 255 0 0 0 0 0 0 0 255 0
0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255 255 0 0 0 0 255 0 255 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 255 0 255
0 0 0 255 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 255 0 0 0 255 0 0 0 0 255 255 0 0
0 0 0 0 0 255 0 0 0 255 0 255 0 0 255 255 255 0 0 255 0 255 0 0 0 255 255
255 255 0 0 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255
0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 255 255 255 0 255 255 255 0 0 255
0 0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255 255 0 0 0
0 0 0 0 0 255 0 0 255 0 0 0 0 0 255 0 0 0 255 0 0 0 255 255 255 0 0 255
0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255
0 0 0 255 0 0 255 0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255
0 0 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0
0 255 0 255 0 0 0 0 255 0 0 0 0 0 0 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255
255 0 255 0 0 0 0 0 0 0 0 0 0 255 255 0 255 0 0 255 0 0 0 0 0 0 255 255
0 255 0 0 0 0 0 255 255 0 0 255 0 0 0 0 0 255 0 0 255 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 127 0 0 0 0 0 255 0 0 255 255 255 0 0 255 0 0 0 0 255 255 255
0 0 0 255 0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 255 0 0 255 255 0 0 255
255 0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 255 0 255 255 255 0 0 255
0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 255 0
0 255 0 255 255 0 255 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 255 0 255 0 255
0 0 0 255 0 255 0 0 0 0 0 0 255 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 0 0
255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 127 0 0 0 0 0 255 0 255 0 255 0 0 255 255 255 0 0 0
255 0 255 0 0 0 0 255 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0 255 0 255 0 0
0 0 255 0 255 255 0 255 0 255 0 0 0 255 255 255 255 255 0 0 0 0 255 0 255
0 0 255 0 255 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 0 0 255 255 255 0
255 255 0 0 0 0 0 0 255 0 0 255 0 255 255 0 255 0 0 255 0 0 0 0 0 0 0 255
255 255 0 255 255 0 0 0 255 0 255 0 0 255 255 0 0 255 255 0 0 0 255 0 255
0 255 255 0 0 255 255 0 255 0 255 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0
0 0 0 255 0 255 0 255 0 0 0 255 0 0 0 0 255 255 255 0 0 0 255 255 255 0
0 0 0 255 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 0 255 0 0 0 0 255 0 255 0
0 0 0 0 0 0 255 0 255 255 0 255 0 255 255 255 0 0 255 0 0 0 0 0 0 0 0 0
0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255 0 0 255 0 255 0 0
255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 0 255 0 255 0 255 0 0
0 0 255 0 0 0 0 255 0 0 0 255 0 255 0 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127
0 0 0 0 0 255 0 255 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0
255 0 0 255 255 255 0 0 0 0 0 0 255 0 0 255 255 0 0 255 0 0 0 0 0 255 0
255 0 0 0 0 0 0 255 0 0 0 0 255 0 255 0 0 255 0 255 0 0 0 0 0 0 0 0 0 0
0 0 127 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255 0 0 255 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 255 0 0 0 0 255 0 255 255 255 255 0
0 0 255 0 0 0 255 0 0 0 0 255 0 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
127 0 0 0 0 0 255 0 0 255 255 255 0 255 255 255 255 0 0 0 0 0 0 0 0 0 255
0 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255 255 255
255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 0 0 255 0 255 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255 0 0 0 255 0 0
0 255 255 255 0 0 255 0 0 0 0 255 0 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0 0
0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 255
0 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 127 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 255 0 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 255 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 127 127 127 0 127 0 127 127 127 127 0 127
127 127 127 0 127 127 127 127 127 0 127 127 127 127 127 0 127 0 127 127
127 127 0 127 127 127 127 0 127 127 127 127 127 127 127 0 127 127 127 0
127 127 127 127 0 127 127 127 127 127 127 0 127 127 0 127 127 127 127 127
127 127 0 127 127 127 127 0 127 127 127 127 0 127 127 127 127 127 0 127
127 127 127 0 127 127 127 0 127 127 127 0 127 127 127 127 0 127 127 127
127 0 127 127 127 0 127 127 127 0 127 127 127 0 127 127 127 127 0 127 127
127 127 0 127 127 127 127 127 127 127 127 0 127 127 127 127 127 127 127
127 0 127 127 127 127 127 127 127 0 127 127 127 127 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0
0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 255 0 255 255 0 0 0 255
0 0 255 0 0 0 0 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0
0 0 0 255 0 0 0 0 255 0 255 0 0 0 255 0 255 0 0 0 255 0 0 0 255 0 0 255
0 255 0 255 0 255 0 0 0 0 0 0 0 0 0 255 0 255 255 0 0 0 0 0 255 0 0 0 0
0 0 0 255 0 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255 255 0 0 0 0 255 0 255
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0
255 0 255 0 0 0 255 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255
0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 0 0 127 0 0
255 255 0 0 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0
255 255 0 0 0 0 0 255 255 0 0 0 0 0 255 255 255 255 255 0 0 0 255 255 255
0 0 255 255 255 255 255 0 255 255 255 255 255 0 255 255 255 255 255 0 255
255 255 255 255 0 255 255 255 0 255 255 255 0 255 255 255 0 255 255 255
0 255 255 255 255 0 0 0 255 0 0 0 0 255 0 0 0 255 255 255 0 0 0 0 0 255
255 255 0 0 0 0 0 255 255 255 0 0 0 0 0 255 255 255 0 0 0 0 0 255 255 255
0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 0 255 0 255 0 0 0 0 255 0 255 0 0 0
0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 255 0 255 0 0 0 0
255 0 0 255 0 127 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0
0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 255 0 255 0 0 0
0 0 255 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0
0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 255 0
0 0 255 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0
255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0
255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0
0 255 0 255 0 0 255 255 255 0 0 255 0 0 255 0 127 0 255 0 0 255 0 0 0 255
0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255
0 0 255 0 0 0 255 0 255 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0
0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0
255 0 0 0 0 255 0 255 0 255 0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0
255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 255
0 0 0 255 0 255 0 0 0 255 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255
0 0 0 0 255 0 255 0 0 0 0 255 0 0 255 0 255 0 0 255 0 0 255 0 255 0 255
0 0 127 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0
255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 255 255 255 255 0 255
0 0 0 0 0 0 255 255 255 255 0 0 255 255 255 255 0 0 255 255 255 255 0 0
255 255 255 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 255 255
0 0 255 0 255 0 0 255 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255
0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 255 0 255 0
0 255 0 0 255 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0
255 0 255 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 0 255 0 0 255 0 127 255
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 0 0 127 0 0 255 255
0 0 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0 255 255
0 0 0 0 0 255 255 0 0 0 0 0 255 255 255 255 255 0 0 0 255 255 255 0 0 255
255 255 255 255 0 255 255 255 255 255 0 255 255 255 255 255 0 255 255 255
255 255 0 255 255 255 0 255 255 255 0 255 255 255 0 255 255 255 0 255 255
255 255 0 0 0 255 0 0 0 0 255 0 0 0 255 255 255 0 0 0 0 0 255 255 255 0
0 0 0 0 255 255 255 0 0 0 0 0 255 255 255 0 0 0 0 0 255 255 255 0 0 0 0
0 0 0 0 0 0 0 0 255 255 255 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0
255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 255 0 255 0 0 0 0 255 0 0
255 0 127 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0 255
255 0 0 0 0 0 255 255 0 0 0 0 0 255 255 0 0 0 0 255 0 255 0 0 0 0 0 255
0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 255
0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 255 0 0 0 255 0
0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0
255 0 0 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255 0 0 255 0 0 0
0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 0 255 0 255
0 0 255 255 255 0 0 255 0 0 255 0 127 0 255 0 0 255 0 0 0 255 0 0 255 0
0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0
0 0 255 0 255 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0
0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 0 0 0
0 255 0 255 0 255 0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255
0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 255 0 0 0 255
0 255 0 0 0 255 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0
255 0 255 0 0 0 0 255 0 0 255 0 255 0 0 255 0 0 255 0 255 0 255 0 0 127
0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0
0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 0 0
0 0 0 255 255 255 255 0 0 255 255 255 255 0 0 255 255 255 255 0 0 255 255
255 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 255 255 0 0 255
0 255 0 0 255 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0
0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 255 0 255 0 0 255
0 0 255 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0
255 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 0 255 0 0 255 0 127 255 255
255 255 255 255 0 255 255 255 255 255 255 0 255 255 255 255 255 255 0 255
255 255 255 255 255 0 255 255 255 255 255 255 0 255 255 255 255 255 255
0 255 255 255 255 255 255 0 255 255 255 255 255 255 0 255 255 255 255 255
255 0 0 255 255 255 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0
255 0 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255
0 0 0 0 255 0 255 0 0 0 255 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255
0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 0 255
0 0 0 255 0 255 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0
0 0 255 0 255 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 0 255 0 0 255 0 127
255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0
255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 255 0 0 0 0 0 255 0 0 0 255
0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 255
0 0 0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 0 255 0 0 255 0 0 0
255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255
0 0 0 255 0 0 0 0 255 0 255 0 0 0 255 0 0 0 255 0 0 255 0 0 0 0 255 0 255
0 0 255 255 255 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255
0 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 0 0
0 0 255 0 255 0 0 0 255 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255
0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 255 0 0 0 0 0 255 0 0 0 0 255 0 0 0
255 0 255 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255
0 255 0 0 0 0 255 0 0 0 255 0 0 0 255 0 0 255 0 255 0 0 255 0 127 255 0
0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0
0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 255 0 0 0 0 0 255 0 0 0 255 0 255
0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 255 0 0 0 0 0 0 255 0 0 0 255 0 0
0 255 0 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 0 0 255 0 0 255 0 0 0 255
0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0
0 0 255 0 0 0 0 255 0 255 0 0 0 255 0 0 0 255 0 0 255 0 0 0 0 255 0 255
0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 0 0 255 0 0 0 255 255
255 0 0 255 0 0 255 0 127 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0
0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 0 0 255 0 255 0 0 255

File diff suppressed because it is too large Load Diff

View File

@@ -71,6 +71,7 @@ void BipartiteBoxPruningTest::Select()
// Create a tweak bar
{
mBar = TwNewBar("BipartiteBoxPruning");
TwAddVarRW(mBar, "Speed", TW_TYPE_FLOAT, &mSpeed, " min=0.0 max=0.01 step=0.00001");
TwAddVarRW(mBar, "Amplitude", TW_TYPE_FLOAT, &mAmplitude, " min=10.0 max=200.0 step=0.1");
}

View File

@@ -236,6 +236,10 @@ static void Terminate()
TwTerminate();
}
int myGlutModifiers()
{
return glutGetModifiers();
}
int main(int argc, char** argv)
{
{
@@ -274,7 +278,7 @@ int main(int argc, char** argv)
atexit(Terminate); // Called after glutMainLoop ends
glutPassiveMotionFunc((GLUTmousemotionfun)TwEventMouseMotionGLUT);
TwGLUTModifiersFunc(glutGetModifiers);
TwGLUTModifiersFunc(myGlutModifiers);
// Setup default render states
glClearColor(0.3f, 0.4f, 0.5f, 1.0);

View File

@@ -2,16 +2,16 @@ Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CDTestFramework", "CDTestFramework.vcproj", "{0565DB39-45CC-416E-B549-BFC24F2666D1}"
ProjectSection(ProjectDependencies) = postProject
{519F115F-F196-49FE-9B24-49618A6202BB} = {519F115F-F196-49FE-9B24-49618A6202BB}
{C0E1329C-3D6F-492D-8EFF-08069F096C6E} = {C0E1329C-3D6F-492D-8EFF-08069F096C6E}
{9D492E35-44FF-5E48-AB83-8A1326AE11F8} = {9D492E35-44FF-5E48-AB83-8A1326AE11F8}
{FA38D972-5689-9844-94F8-B26C144B6AC4} = {FA38D972-5689-9844-94F8-B26C144B6AC4}
{DBE44CA3-2912-4441-8D99-AA2242688AD2} = {DBE44CA3-2912-4441-8D99-AA2242688AD2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Opcode", "Opcode\Opcode.vcproj", "{DBE44CA3-2912-4441-8D99-AA2242688AD2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LinearMath", "..\..\msvc\2008\src\LinearMath\LinearMath.vcproj", "{519F115F-F196-49FE-9B24-49618A6202BB}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BulletCollision", "..\..\build\vs2008\BulletCollision.vcproj", "{9D492E35-44FF-5E48-AB83-8A1326AE11F8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BulletCollision", "..\..\msvc\2008\src\BulletCollision\BulletCollision.vcproj", "{C0E1329C-3D6F-492D-8EFF-08069F096C6E}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LinearMath", "..\..\build\vs2008\LinearMath.vcproj", "{FA38D972-5689-9844-94F8-B26C144B6AC4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -57,38 +57,38 @@ Global
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.ReleaseDoublePrecision|Win32.Build.0 = Release|Win32
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
{DBE44CA3-2912-4441-8D99-AA2242688AD2}.RelWithDebInfo|Win32.Build.0 = Release|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.Debug|Win32.ActiveCfg = Debug|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.Debug|Win32.Build.0 = Debug|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.DebugDll|Win32.ActiveCfg = Debug|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.DebugDll|Win32.Build.0 = Debug|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.DebugDoublePrecision|Win32.ActiveCfg = Debug|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.DebugDoublePrecision|Win32.Build.0 = Debug|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.Release|Win32.ActiveCfg = Release|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.Release|Win32.Build.0 = Release|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.ReleaseDll|Win32.ActiveCfg = Release|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.ReleaseDll|Win32.Build.0 = Release|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.ReleaseDoublePrecision|Win32.ActiveCfg = Release|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.ReleaseDoublePrecision|Win32.Build.0 = Release|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
{519F115F-F196-49FE-9B24-49618A6202BB}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.Debug|Win32.ActiveCfg = Debug|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.Debug|Win32.Build.0 = Debug|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.DebugDll|Win32.ActiveCfg = Debug|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.DebugDll|Win32.Build.0 = Debug|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.DebugDoublePrecision|Win32.ActiveCfg = Debug|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.DebugDoublePrecision|Win32.Build.0 = Debug|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.Release|Win32.ActiveCfg = Release|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.Release|Win32.Build.0 = Release|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.ReleaseDll|Win32.ActiveCfg = Release|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.ReleaseDll|Win32.Build.0 = Release|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.ReleaseDoublePrecision|Win32.ActiveCfg = Release|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.ReleaseDoublePrecision|Win32.Build.0 = Release|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
{C0E1329C-3D6F-492D-8EFF-08069F096C6E}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.Debug|Win32.ActiveCfg = Debug|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.Debug|Win32.Build.0 = Debug|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.DebugDll|Win32.ActiveCfg = Debug|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.DebugDll|Win32.Build.0 = Debug|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.DebugDoublePrecision|Win32.ActiveCfg = Debug|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.DebugDoublePrecision|Win32.Build.0 = Debug|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.MinSizeRel|Win32.ActiveCfg = Debug|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.MinSizeRel|Win32.Build.0 = Debug|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.Release|Win32.ActiveCfg = Release|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.Release|Win32.Build.0 = Release|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.ReleaseDll|Win32.ActiveCfg = Release|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.ReleaseDll|Win32.Build.0 = Release|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.ReleaseDoublePrecision|Win32.ActiveCfg = Release|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.ReleaseDoublePrecision|Win32.Build.0 = Release|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
{9D492E35-44FF-5E48-AB83-8A1326AE11F8}.RelWithDebInfo|Win32.Build.0 = Release|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.Debug|Win32.ActiveCfg = Debug|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.Debug|Win32.Build.0 = Debug|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.DebugDll|Win32.ActiveCfg = Debug|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.DebugDll|Win32.Build.0 = Debug|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.DebugDoublePrecision|Win32.ActiveCfg = Debug|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.DebugDoublePrecision|Win32.Build.0 = Debug|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.MinSizeRel|Win32.ActiveCfg = Debug|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.MinSizeRel|Win32.Build.0 = Debug|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.Release|Win32.ActiveCfg = Release|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.Release|Win32.Build.0 = Release|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.ReleaseDll|Win32.ActiveCfg = Release|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.ReleaseDll|Win32.Build.0 = Release|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.ReleaseDoublePrecision|Win32.ActiveCfg = Release|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.ReleaseDoublePrecision|Win32.Build.0 = Release|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
{FA38D972-5689-9844-94F8-B26C144B6AC4}.RelWithDebInfo|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -48,7 +48,7 @@
ExceptionHandling="0"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
@@ -130,7 +130,7 @@
EnableEnhancedInstructionSet="0"
FloatingPointModel="2"
RuntimeTypeInfo="false"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="0"
@@ -264,6 +264,14 @@
RelativePath=".\IceHelpers.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\LoadOGL.cpp"
>
</File>
<File
RelativePath=".\AntTweakBar\src\LoadOGLCore.cpp"
>
</File>
<File
RelativePath=".\OBBMeshQuery.cpp"
>
@@ -332,18 +340,98 @@
RelativePath=".\Terrain.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwBar.cpp"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwColors.cpp"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwEventGLUT.c"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwFonts.cpp"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwMgr.cpp"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwOpenGL.cpp"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwOpenGLCore.cpp"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwPrecomp.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\AntTweakBar\src\AntPerfTimer.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\LoadOGL.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\LoadOGLCore.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwBar.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwColors.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwFonts.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwGraph.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwMgr.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwOpenGL.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwOpenGLCore.h"
>
</File>
<File
RelativePath=".\AntTweakBar\src\TwPrecomp.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\AntTweakBar\src\AntTweakBar.rc"
>
</File>
</Filter>
<File
RelativePath=".\CDTestFramework.txt"

View File

@@ -152,7 +152,7 @@ void CompleteBoxPruningTest::PerformTest()
char Buffer[4096];
sprintf(Buffer, "CompleteBoxPruning: %5.1f us (%d cycles) : %d pairs\n", mProfiler.mMsTime, mProfiler.mCycles, mPairs.GetNbPairs());
GLFontRenderer::print(10.0f, 10.0f, 0.02f, Buffer);
GLFontRenderer::print(10.0f, 10.0f, 0.01f, Buffer);
}
void CompleteBoxPruningTest::KeyboardCallback(unsigned char key, int x, int y)

View File

@@ -333,6 +333,7 @@ btCollisionShape* btWorldImporter::convertCollisionShape( btCollisionShapeData*
{
hullShape->addPoint(tmpPoints[i]);
}
//hullShape->initializePolyhedralFeatures();
shape = hullShape;
break;
}
@@ -419,11 +420,17 @@ btCollisionShape* btWorldImporter::convertCollisionShape( btCollisionShapeData*
btCompoundShapeData* compoundData = (btCompoundShapeData*)shapeData;
btCompoundShape* compoundShape = createCompoundShape();
btCompoundShapeChildData* childShapeDataArray = &compoundData->m_childShapePtr[0];
btAlignedObjectArray<btCollisionShape*> childShapes;
for (int i=0;i<compoundData->m_numChildShapes;i++)
{
btCollisionShape* childShape = convertCollisionShape(compoundData->m_childShapePtr[i].m_childShape);
btCompoundShapeChildData* ptr = &compoundData->m_childShapePtr[i];
btCollisionShapeData* cd = compoundData->m_childShapePtr[i].m_childShape;
btCollisionShape* childShape = convertCollisionShape(cd);
if (childShape)
{
btTransform localTransform;

View File

@@ -18,9 +18,6 @@ subject to the following restrictions:
#include "btBulletDynamicsCommon.h"
#include "string_split.h"
#if defined(__APPLE__) || defined(__CELLOS_LV2__)
#define stricmp(a, b) strcasecmp((a), (b))
#endif
btBulletXmlWorldImporter::btBulletXmlWorldImporter(btDynamicsWorld* world)
:btWorldImporter(world),
@@ -61,7 +58,7 @@ static int get_int_attribute_by_name(const TiXmlElement* pElement, const char* a
const TiXmlAttribute* pAttrib=pElement->FirstAttribute();
while (pAttrib)
{
if (!stricmp(pAttrib->Name(),attribName))
if (!strcmp(pAttrib->Name(),attribName))
if (pAttrib->QueryIntValue(value)==TIXML_SUCCESS)
return 1;
// if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval);
@@ -115,11 +112,13 @@ void btBulletXmlWorldImporter::deSerializeVector3FloatData(TiXmlNode* pParent,bt
#define SET_INT_VALUE(xmlnode, targetdata, argname) \
btAssert((xmlnode)->FirstChild(#argname) && (xmlnode)->FirstChild(#argname)->ToElement());\
if ((xmlnode)->FirstChild(#argname) && (xmlnode)->FirstChild(#argname)->ToElement())\
(targetdata)->argname= (int)atof(xmlnode->FirstChild(#argname)->ToElement()->GetText());
#define SET_FLOAT_VALUE(xmlnode, targetdata, argname) \
btAssert((xmlnode)->FirstChild(#argname) && (xmlnode)->FirstChild(#argname)->ToElement());\
if ((xmlnode)->FirstChild(#argname) && (xmlnode)->FirstChild(#argname)->ToElement())\
(targetdata)->argname= (float)atof(xmlnode->FirstChild(#argname)->ToElement()->GetText());
@@ -127,6 +126,7 @@ void btBulletXmlWorldImporter::deSerializeVector3FloatData(TiXmlNode* pParent,bt
#define SET_POINTER_VALUE(xmlnode, targetdata, argname, pointertype) \
{\
TiXmlNode* node = xmlnode->FirstChild(#argname);\
btAssert(node);\
if (node)\
{\
const char* txt = (node)->ToElement()->GetText();\
@@ -153,6 +153,7 @@ void btBulletXmlWorldImporter::deSerializeVector3FloatData(TiXmlNode* pParent,bt
#define SET_MATRIX33_VALUE(n, targetdata, argname) \
{\
TiXmlNode* xmlnode = n->FirstChild(#argname);\
btAssert(xmlnode);\
if (xmlnode)\
{\
TiXmlNode* eleNode = xmlnode->FirstChild("m_el");\
@@ -167,6 +168,7 @@ void btBulletXmlWorldImporter::deSerializeVector3FloatData(TiXmlNode* pParent,bt
(targetdata)->argname.m_el[0].m_floats[3] = vec4.m_floats[3];\
\
TiXmlNode* n1 = eleNode->FirstChild()->NextSibling();\
btAssert(n1);\
if (n1)\
{\
const char* txt= n1->ToElement()->GetText();\
@@ -177,6 +179,7 @@ void btBulletXmlWorldImporter::deSerializeVector3FloatData(TiXmlNode* pParent,bt
(targetdata)->argname.m_el[1].m_floats[3] = vec4.m_floats[3];\
\
TiXmlNode* n2 = n1->NextSibling();\
btAssert(n2);\
if (n2)\
{\
const char* txt= n2->ToElement()->GetText();\
@@ -194,6 +197,7 @@ void btBulletXmlWorldImporter::deSerializeVector3FloatData(TiXmlNode* pParent,bt
#define SET_TRANSFORM_VALUE(n, targetdata, argname) \
{\
TiXmlNode* trNode = n->FirstChild(#argname);\
btAssert(trNode);\
if (trNode)\
{\
SET_VECTOR4_VALUE(trNode,&(targetdata)->argname,m_origin)\
@@ -242,17 +246,55 @@ void btBulletXmlWorldImporter::deSerializeCompoundShapeChildData(TiXmlNode* pPar
int ptr;
get_int_attribute_by_name(pParent->ToElement(),"pointer",&ptr);
btCompoundShapeChildData* compoundChildData = (btCompoundShapeChildData*) btAlignedAlloc(sizeof(btCompoundShapeChildData),16);
int numChildren = 0;
btAlignedObjectArray<btCompoundShapeChildData>* compoundChildArrayPtr = new btAlignedObjectArray<btCompoundShapeChildData>;
{
TiXmlNode* transNode = pParent->FirstChild("m_transform");
TiXmlNode* colShapeNode = pParent->FirstChild("m_childShape");
TiXmlNode* marginNode = pParent->FirstChild("m_childMargin");
TiXmlNode* childTypeNode = pParent->FirstChild("m_childShapeType");
SET_TRANSFORM_VALUE(pParent, compoundChildData,m_transform);
SET_POINTER_VALUE(pParent, *compoundChildData,m_childShape,btCollisionShapeData*);
int i=0;
while (transNode && colShapeNode && marginNode && childTypeNode)
{
compoundChildArrayPtr->expandNonInitializing();
SET_VECTOR4_VALUE (transNode,&compoundChildArrayPtr->at(i).m_transform,m_origin)
SET_MATRIX33_VALUE(transNode,&compoundChildArrayPtr->at(i).m_transform,m_basis)
const char* txt = (colShapeNode)->ToElement()->GetText();
compoundChildArrayPtr->at(i).m_childShape = (btCollisionShapeData*) (int) atof(txt);
btAssert(childTypeNode->ToElement());
if (childTypeNode->ToElement())
{
compoundChildArrayPtr->at(i).m_childShapeType = (int)atof(childTypeNode->ToElement()->GetText());
}
btAssert(marginNode->ToElement());
if (marginNode->ToElement())
{
compoundChildArrayPtr->at(i).m_childMargin = (float)atof(marginNode->ToElement()->GetText());
}
transNode = transNode->NextSibling("m_transform");
colShapeNode = colShapeNode->NextSibling("m_childShape");
marginNode = marginNode->NextSibling("m_childMargin");
childTypeNode = childTypeNode->NextSibling("m_childShapeType");
i++;
}
numChildren = i;
}
btAssert(numChildren);
if (numChildren)
{
m_compoundShapeChildDataArrays.push_back(compoundChildArrayPtr);
btCompoundShapeChildData* cd = &compoundChildArrayPtr->at(0);
m_pointerLookup.insert(ptr,cd);
}
SET_INT_VALUE(pParent, compoundChildData, m_childShapeType);
SET_FLOAT_VALUE(pParent, compoundChildData, m_childMargin);
m_compoundShapeChildData.push_back(compoundChildData);
m_pointerLookup.insert(ptr,compoundChildData);
}
void btBulletXmlWorldImporter::deSerializeCompoundShapeData(TiXmlNode* pParent)
@@ -262,12 +304,27 @@ void btBulletXmlWorldImporter::deSerializeCompoundShapeData(TiXmlNode* pParent)
btCompoundShapeData* compoundData = (btCompoundShapeData*) btAlignedAlloc(sizeof(btCompoundShapeData),16);
TiXmlNode* xmlColShape = pParent ->FirstChild("m_collisionShapeData");
btAssert(xmlColShape);
deSerializeCollisionShapeData(xmlColShape,&compoundData->m_collisionShapeData);
SET_INT_VALUE(pParent, compoundData,m_numChildShapes);
TiXmlNode* xmlShapeData = pParent->FirstChild("m_collisionShapeData");
btAssert(xmlShapeData );
deSerializeCollisionShapeData(xmlShapeData,&compoundData->m_collisionShapeData);
SET_POINTER_VALUE(pParent, *compoundData,m_childShapePtr,btCompoundShapeChildData*);
SET_INT_VALUE(pParent, compoundData,m_numChildShapes);
{
TiXmlNode* node = pParent->FirstChild("m_childShapePtr");\
btAssert(node);
while (node)
{
const char* txt = (node)->ToElement()->GetText();
compoundData->m_childShapePtr = (btCompoundShapeChildData*) (int) atof(txt);
node = node->NextSibling("m_childShapePtr");
}
//SET_POINTER_VALUE(xmlColShape, *compoundData,m_childShapePtr,btCompoundShapeChildData*);
}
SET_FLOAT_VALUE(pParent, compoundData,m_collisionMargin);
m_collisionShapeData.push_back((btCollisionShapeData*)compoundData);
@@ -524,11 +581,15 @@ void btBulletXmlWorldImporter::fixupCollisionDataPointers(btCollisionShapeData*
{
btCompoundShapeData* compound = (btCompoundShapeData*) shapeData;
int ptr = (intptr_t) compound->m_childShapePtr;
btCompoundShapeChildData** c = (btCompoundShapeChildData**)m_pointerLookup.find(ptr);
void** cdptr = m_pointerLookup.find(ptr);
btCompoundShapeChildData** c = (btCompoundShapeChildData**)cdptr;
btAssert(c);
if (c)
{
compound->m_childShapePtr = *c;
} else
{
compound->m_childShapePtr = 0;
}
break;
}
@@ -542,6 +603,9 @@ void btBulletXmlWorldImporter::fixupCollisionDataPointers(btCollisionShapeData*
if (ptrptr)
{
convexData->m_unscaledPointsFloatPtr = *ptrptr;
} else
{
convexData->m_unscaledPointsFloatPtr = 0;
}
break;
}
@@ -570,7 +634,7 @@ void btBulletXmlWorldImporter::auto_serialize_root_level_children(TiXmlNode* pPa
for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling(), numChildren++)
{
// printf("child Name=%s\n", pChild->Value());
if (!stricmp(pChild->Value(),"btVector3FloatData"))
if (!strcmp(pChild->Value(),"btVector3FloatData"))
{
int ptr;
get_int_attribute_by_name(pChild->ToElement(),"pointer",&ptr);
@@ -586,56 +650,56 @@ void btBulletXmlWorldImporter::auto_serialize_root_level_children(TiXmlNode* pPa
continue;
}
if (!stricmp(pChild->Value(),"btGeneric6DofConstraintData"))
if (!strcmp(pChild->Value(),"btGeneric6DofConstraintData"))
{
deSerializeGeneric6DofConstraintData(pChild);
continue;
}
if (!stricmp(pChild->Value(),"btStaticPlaneShapeData"))
if (!strcmp(pChild->Value(),"btStaticPlaneShapeData"))
{
deSerializeStaticPlaneShapeData(pChild);
continue;
}
if (!stricmp(pChild->Value(),"btCompoundShapeData"))
if (!strcmp(pChild->Value(),"btCompoundShapeData"))
{
deSerializeCompoundShapeData(pChild);
continue;
}
if (!stricmp(pChild->Value(),"btCompoundShapeChildData"))
if (!strcmp(pChild->Value(),"btCompoundShapeChildData"))
{
deSerializeCompoundShapeChildData(pChild);
continue;
}
if (!stricmp(pChild->Value(),"btConvexHullShapeData"))
if (!strcmp(pChild->Value(),"btConvexHullShapeData"))
{
deSerializeConvexHullShapeData(pChild);
continue;
}
if (!stricmp(pChild->Value(),"btDynamicsWorldFloatData"))
if (!strcmp(pChild->Value(),"btDynamicsWorldFloatData"))
{
deSerializeDynamicsWorldData(pChild);
continue;
}
if (!stricmp(pChild->Value(),"btConvexInternalShapeData"))
if (!strcmp(pChild->Value(),"btConvexInternalShapeData"))
{
deSerializeConvexInternalShapeData(pChild);
continue;
}
if (!stricmp(pChild->Value(),"btRigidBodyFloatData"))
if (!strcmp(pChild->Value(),"btRigidBodyFloatData"))
{
deSerializeRigidBodyFloatData(pChild);
continue;
}
printf("Error: btBulletXmlWorldImporter doesn't support %s yet\n", pChild->Value());
btAssert(0);
//printf("Error: btBulletXmlWorldImporter doesn't support %s yet\n", pChild->Value());
// btAssert(0);
}
}
@@ -643,15 +707,19 @@ void btBulletXmlWorldImporter::auto_serialize_root_level_children(TiXmlNode* pPa
///fixup pointers in various places, in the right order
//fixup compoundshape child data
for (int i=0;i<m_compoundShapeChildData.size();i++)
for (int i=0;i<m_compoundShapeChildDataArrays.size();i++)
{
btCompoundShapeChildData* childData = m_compoundShapeChildData[i];
int hashKey = (intptr_t) childData->m_childShape;
btCollisionShapeData** ptrptr = (btCollisionShapeData**)m_pointerLookup[hashKey];
btAssert(ptrptr);
if (ptrptr)
btAlignedObjectArray<btCompoundShapeChildData>* childDataArray = m_compoundShapeChildDataArrays[i];
for (int c=0;c<childDataArray->size();c++)
{
childData->m_childShape = *ptrptr;
btCompoundShapeChildData* childData = &childDataArray->at(c);
int hashKey = (intptr_t) childData->m_childShape;
btCollisionShapeData** ptrptr = (btCollisionShapeData**)m_pointerLookup[hashKey];
btAssert(ptrptr);
if (ptrptr)
{
childData->m_childShape = *ptrptr;
}
}
}
@@ -668,7 +736,7 @@ void btBulletXmlWorldImporter::auto_serialize_root_level_children(TiXmlNode* pPa
btRigidBodyData* rbData = m_rigidBodyData[i];
int hashKey = (intptr_t)rbData->m_collisionObjectData.m_collisionShape;
void** ptrptr = m_pointerLookup.find(hashKey);
btAssert(ptrptr);
//btAssert(ptrptr);
rbData->m_collisionObjectData.m_broadphaseHandle = 0;
rbData->m_collisionObjectData.m_rootCollisionShape = 0;
rbData->m_collisionObjectData.m_name = 0;//tbd

View File

@@ -40,7 +40,7 @@ class btBulletXmlWorldImporter : public btWorldImporter
protected:
btAlignedObjectArray<btCollisionShapeData*> m_collisionShapeData;
btAlignedObjectArray<btCompoundShapeChildData*> m_compoundShapeChildData;
btAlignedObjectArray<btAlignedObjectArray<btCompoundShapeChildData>* > m_compoundShapeChildDataArrays;
btAlignedObjectArray<btRigidBodyData*> m_rigidBodyData;
btAlignedObjectArray<btTypedConstraintData*> m_constraintData;
btHashMap<btHashInt,void*> m_pointerLookup;

View File

@@ -21,6 +21,8 @@ subject to the following restrictions:
#include "string_split.h"
///todo: remove stl dependency
namespace bullet_utils
{
void split( btAlignedObjectArray<std::string>&pieces, const std::string& vector_str, const std::string& separator)