First commit
This commit is contained in:
commit
71b4262c51
|
|
@ -0,0 +1,133 @@
|
||||||
|
#include <cstring>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
int test1(const std::string& str, const char* pattern)
|
||||||
|
{
|
||||||
|
const char* ch = &str[0];
|
||||||
|
unsigned int lastResult = -1;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
char* r = strstr(ch, pattern);
|
||||||
|
if (!r)
|
||||||
|
return lastResult;
|
||||||
|
|
||||||
|
lastResult = r - &str[0];
|
||||||
|
|
||||||
|
ch = r+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int test2(const std::string& str, const char* pattern)
|
||||||
|
{
|
||||||
|
const char* s = str.c_str();
|
||||||
|
|
||||||
|
unsigned int size = std::strlen(pattern);
|
||||||
|
const char* ptr = &s[str.size()-1];
|
||||||
|
const char* limit = &s[size-1];
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (*ptr == pattern[size-1])
|
||||||
|
{
|
||||||
|
const char* p = &pattern[size-1];
|
||||||
|
for (; p >= &pattern[0]; --p, --ptr)
|
||||||
|
{
|
||||||
|
if (*ptr != *p)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (p == &pattern[0])
|
||||||
|
return ptr-s;
|
||||||
|
|
||||||
|
if (ptr == s)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (ptr-- <= limit)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int test3(const std::string& str, const char* pattern)
|
||||||
|
{
|
||||||
|
const char* strPtr = str.c_str();
|
||||||
|
const char* ptr = &strPtr[str.size()-1];
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (*ptr == pattern[0])
|
||||||
|
{
|
||||||
|
const char* p = &pattern[1];
|
||||||
|
const char* tPtr = ptr+1;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (*p == '\0')
|
||||||
|
return ptr-strPtr;
|
||||||
|
|
||||||
|
if (*tPtr != *p)
|
||||||
|
break;
|
||||||
|
|
||||||
|
p++;
|
||||||
|
tPtr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (ptr-- != strPtr);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int test4(const std::string& str, const std::string& pattern)
|
||||||
|
{
|
||||||
|
const char* s = str.c_str();
|
||||||
|
|
||||||
|
unsigned int size = pattern.size();
|
||||||
|
const char* ptr = &s[str.size()-1];
|
||||||
|
const char* limit = &s[size-1];
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (*ptr == pattern[size-1])
|
||||||
|
{
|
||||||
|
const char* p = &pattern[size-1];
|
||||||
|
for (; p >= &pattern[0]; --p, --ptr)
|
||||||
|
{
|
||||||
|
if (*ptr != *p)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (p == &pattern[0])
|
||||||
|
return ptr-s;
|
||||||
|
|
||||||
|
if (ptr == s)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (ptr-- <= limit)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int test5(const std::string& str, const std::string& pattern)
|
||||||
|
{
|
||||||
|
unsigned int size = pattern.size();
|
||||||
|
const char* ptr = &str[str.size()];
|
||||||
|
const char* limit = &str[size-1];
|
||||||
|
|
||||||
|
const char* patternStr = pattern.c_str();
|
||||||
|
while (ptr-- > limit)
|
||||||
|
{
|
||||||
|
if (*ptr == pattern[size-1])
|
||||||
|
{
|
||||||
|
if (static_cast<unsigned int>(&patternStr[str.size()-1]-ptr) < size)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (std::memcmp(ptr-size+1, patternStr, size*sizeof(char)) == 0)
|
||||||
|
return (ptr-size+1) - &str[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
#include <cstring>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
int test1(const std::string& str, const char* pattern)
|
||||||
|
{
|
||||||
|
const char* strPtr = str.c_str();
|
||||||
|
const char* ptr = &strPtr[str.size()-1];
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (*ptr == pattern[0])
|
||||||
|
{
|
||||||
|
if (ptr != strPtr && !std::isspace(*(ptr-1)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const char* p = &pattern[1];
|
||||||
|
const char* tPtr = ptr+1;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (*p == '\0')
|
||||||
|
{
|
||||||
|
if (*tPtr == '\0' || std::isspace(*tPtr))
|
||||||
|
return ptr-strPtr;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*tPtr != *p)
|
||||||
|
break;
|
||||||
|
|
||||||
|
p++;
|
||||||
|
tPtr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (ptr-- != strPtr);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int test2(const std::string& str, const std::string& pattern)
|
||||||
|
{
|
||||||
|
const char* s = str.c_str();
|
||||||
|
|
||||||
|
unsigned int size = pattern.size();
|
||||||
|
const char* ptr = &s[str.size()-1];
|
||||||
|
const char* limit = &s[size-1];
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (*ptr == pattern[size-1])
|
||||||
|
{
|
||||||
|
if (*(ptr+1) != '\0' && !std::isspace(*(ptr+1)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const char* p = &pattern[size-1];
|
||||||
|
for (; p >= &pattern[0]; --p, --ptr)
|
||||||
|
{
|
||||||
|
if (*ptr != *p)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (p == &pattern[0])
|
||||||
|
{
|
||||||
|
if (ptr == s || std::isspace(*(ptr-1)))
|
||||||
|
return ptr-s;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (ptr == s)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (ptr-- > limit);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
#include <cstring>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
int test1(const std::string& str, const char* pattern)
|
||||||
|
{
|
||||||
|
const char* s = str.c_str();
|
||||||
|
const char* ch = s;
|
||||||
|
unsigned int size = std::strlen(pattern);
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
char* r = strstr(ch, pattern);
|
||||||
|
if (!r)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
// Si le pattern est bien isolé
|
||||||
|
if ((r == s || std::isspace(*(r-1))) && (*(r+size) == '\0' || std::isspace(*(r+size))))
|
||||||
|
return r-s;
|
||||||
|
|
||||||
|
ch = r+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int test2(const std::string& str, const std::string& pattern)
|
||||||
|
{
|
||||||
|
const char* s = str.c_str();
|
||||||
|
const char* ch = s;
|
||||||
|
unsigned int size = pattern.size();
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
char* r = strstr(ch, pattern.c_str());
|
||||||
|
if (!r)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
// Si le pattern est bien isolé
|
||||||
|
if ((r == s || std::isspace(*(r-1))) && (*(r+size) == '\0' || std::isspace(*(r+size))))
|
||||||
|
return r-s;
|
||||||
|
|
||||||
|
ch = r+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int test3(const std::string& str, const char* pattern)
|
||||||
|
{
|
||||||
|
const char* s = str.c_str();
|
||||||
|
const char* ptr = s;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (*ptr == pattern[0])
|
||||||
|
{
|
||||||
|
if (ptr != s && !std::isspace(*(ptr-1)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const char* p = &pattern[1];
|
||||||
|
const char* tPtr = ptr+1;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (*p == '\0')
|
||||||
|
{
|
||||||
|
if (*tPtr == '\0' || std::isspace(*tPtr))
|
||||||
|
return ptr-s;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*tPtr != *p)
|
||||||
|
break;
|
||||||
|
|
||||||
|
p++;
|
||||||
|
tPtr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (*ptr++ != '\0');
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
#include <cstring>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
int test1(const std::string& str, const std::string& oldString, const std::string& replaceString)
|
||||||
|
{
|
||||||
|
unsigned int count = 0;
|
||||||
|
unsigned int newSize = str.size()+15; // Pour éviter le Count, on considère que la chaine finale aura quinze caractères de plus
|
||||||
|
char* newString = new char[newSize+1];
|
||||||
|
|
||||||
|
char* ptr = &newString[0];
|
||||||
|
for (unsigned int i = 0; i < str.size(); ++i)
|
||||||
|
{
|
||||||
|
if (str.c_str()[i] == oldString[0] && std::memcmp(&str.c_str()[i], oldString.c_str(), oldString.size()*sizeof(char)) == 0)
|
||||||
|
{
|
||||||
|
std::memcpy(ptr, replaceString.c_str(), replaceString.size()*sizeof(char));
|
||||||
|
ptr += replaceString.size();
|
||||||
|
i += oldString.size()-1;
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*ptr++ = str.c_str()[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
newString[newSize] = '\0';
|
||||||
|
|
||||||
|
delete[] newString;
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int test2(const std::string& str, const std::string& oldString, const std::string& replaceString)
|
||||||
|
{
|
||||||
|
unsigned int count = 0;
|
||||||
|
unsigned int newSize = str.size()+15; // Pour éviter le Count, on considère que la chaine finale aura quinze caractères de plus
|
||||||
|
char* newString = new char[newSize+1];
|
||||||
|
|
||||||
|
char* ptr = newString;
|
||||||
|
const char* p = str.c_str();
|
||||||
|
char* r = strstr(p, oldString.c_str());
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
std::memcpy(ptr, p, (r-p)*sizeof(char));
|
||||||
|
ptr += r-p;
|
||||||
|
std::memcpy(ptr, replaceString.c_str(), (replaceString.size())*sizeof(char));
|
||||||
|
ptr += replaceString.size();
|
||||||
|
p = r+oldString.size();
|
||||||
|
|
||||||
|
count++;
|
||||||
|
|
||||||
|
r = strstr(p+1, oldString.c_str());
|
||||||
|
if (!r)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::strcpy(ptr, p);
|
||||||
|
|
||||||
|
delete[] newString;
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
#include <cstring>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
inline char lower(char c)
|
||||||
|
{
|
||||||
|
return ((c >= 65 && c <= 91) ? c+32 : c);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline char upper(char c)
|
||||||
|
{
|
||||||
|
return ((c >= 97 && c <= 123) ? c-32 : c);
|
||||||
|
}
|
||||||
|
|
||||||
|
int test1(const std::string& str, char character)
|
||||||
|
{
|
||||||
|
char character_lower = lower(character);
|
||||||
|
char character_upper = upper(character);
|
||||||
|
unsigned int count = 0;
|
||||||
|
const char* ptr = str.c_str();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (*ptr == character_lower || *ptr == character_upper)
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
while (*ptr++);
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int test2(const std::string& str, char character)
|
||||||
|
{
|
||||||
|
static char tosearch[3];
|
||||||
|
char character_lower = lower(character);
|
||||||
|
char character_upper = upper(character);
|
||||||
|
tosearch[0] = character_lower;
|
||||||
|
tosearch[1] = character_upper;
|
||||||
|
tosearch[2] = '\0';
|
||||||
|
|
||||||
|
const char* ptr = str.c_str();
|
||||||
|
unsigned int count = 0;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
ptr = std::strpbrk(ptr, tosearch);
|
||||||
|
if (!ptr)
|
||||||
|
break;
|
||||||
|
|
||||||
|
count++;
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int test3(const std::string& str, char character)
|
||||||
|
{
|
||||||
|
char character_lower = lower(character);
|
||||||
|
unsigned int count = 0;
|
||||||
|
const char* ptr = str.c_str();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (lower(*ptr) == character_lower)
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
while (*ptr++);
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
project "NazaraModuleName"
|
||||||
|
|
||||||
|
files
|
||||||
|
{
|
||||||
|
"../include/Nazara/ModuleName/**.hpp",
|
||||||
|
"../include/Nazara/ModuleName/**.inl",
|
||||||
|
"../src/Nazara/ModuleName/**.hpp",
|
||||||
|
"../src/Nazara/ModuleName/**.cpp"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os.is("windows")) then
|
||||||
|
excludes { "../src/Nazara/ModuleName/Posix/*.hpp", "../src/Nazara/ModuleName/Posix/*.cpp" }
|
||||||
|
else
|
||||||
|
excludes { "../src/Nazara/ModuleName/Win32/*.hpp", "../src/Nazara/ModuleName/Win32/*.cpp" }
|
||||||
|
end
|
||||||
|
|
||||||
|
configuration "DebugStatic"
|
||||||
|
links "NazaraCored-s"
|
||||||
|
targetname "NazaraModuleNamed"
|
||||||
|
|
||||||
|
configuration "ReleaseStatic"
|
||||||
|
links "NazaraCore-s"
|
||||||
|
targetname "NazaraModuleName"
|
||||||
|
|
||||||
|
configuration "DebugDLL"
|
||||||
|
links "NazaraCored"
|
||||||
|
targetname "NazaraModuleNamed"
|
||||||
|
|
||||||
|
configuration "ReleaseDLL"
|
||||||
|
links "NazaraCore"
|
||||||
|
targetname "NazaraModuleName"
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
Nazara Engine
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CONFIG_MODULENAME_HPP
|
||||||
|
#define NAZARA_CONFIG_MODULENAME_HPP
|
||||||
|
|
||||||
|
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||||
|
|
||||||
|
// Utilise un tracker pour repérer les éventuels leaks (Ralentit l'exécution)
|
||||||
|
#define NAZARA_MODULENAME_MEMORYLEAKTRACKER 0
|
||||||
|
|
||||||
|
#endif // NAZARA_CONFIG_MODULENAME_HPP
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/ModuleName/Config.hpp>
|
||||||
|
#if NAZARA_MODULENAME_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||||
|
#define new new(__FILE__, __LINE__)
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#if NAZARA_MODULENAME_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#undef delete
|
||||||
|
#undef new
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/ModuleName/Config.hpp>
|
||||||
|
#if NAZARA_MODULENAME_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
#include <new>
|
||||||
|
|
||||||
|
void* operator new(std::size_t size) throw(std::bad_alloc)
|
||||||
|
{
|
||||||
|
return NzMemoryManager::Allocate(size, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* operator new[](std::size_t size) throw(std::bad_alloc)
|
||||||
|
{
|
||||||
|
return NzMemoryManager::Allocate(size, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete(void* pointer) throw()
|
||||||
|
{
|
||||||
|
NzMemoryManager::Free(pointer, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete[](void* pointer) throw()
|
||||||
|
{
|
||||||
|
NzMemoryManager::Free(pointer, true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
premake4 codeblocks
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
premake4 vs2010
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_workspace_file>
|
||||||
|
<Workspace title="Nazara">
|
||||||
|
<Project filename="NazaraAudio.cbp">
|
||||||
|
<Depends filename="NazaraCore.cbp" />
|
||||||
|
</Project>
|
||||||
|
<Project filename="NazaraCore.cbp" />
|
||||||
|
<Project filename="NazaraNetwork.cbp">
|
||||||
|
<Depends filename="NazaraCore.cbp" />
|
||||||
|
</Project>
|
||||||
|
<Project filename="NazaraRenderer.cbp" active="1">
|
||||||
|
<Depends filename="NazaraCore.cbp" />
|
||||||
|
<Depends filename="NazaraUtility.cbp" />
|
||||||
|
</Project>
|
||||||
|
<Project filename="NazaraUtility.cbp">
|
||||||
|
<Depends filename="NazaraCore.cbp" />
|
||||||
|
</Project>
|
||||||
|
<Project filename="../NazaraTest/NazaraTest.cbp" />
|
||||||
|
</Workspace>
|
||||||
|
</CodeBlocks_workspace_file>
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="NazaraAudio" />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="DebugStatic">
|
||||||
|
<Option output="../lib/libNazaraAudiod-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/DebugStatic/NazaraAudio" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCored-s" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseStatic">
|
||||||
|
<Option output="../lib/libNazaraAudio-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/ReleaseStatic/NazaraAudio" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCore-s" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="DebugDLL">
|
||||||
|
<Option output="../lib/NazaraAudiod.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/DebugDLL/NazaraAudio" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createDefFile="0" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option="-Wl,--out-implib="../lib/libNazaraAudiod.a"" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCored" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseDLL">
|
||||||
|
<Option output="../lib/NazaraAudio.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/ReleaseDLL/NazaraAudio" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createDefFile="0" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option="-Wl,--out-implib="../lib/libNazaraAudio.a"" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCore" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Unit filename="../include/Nazara/Audio/Config.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Audio/Debug.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Audio/DebugOff.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Audio/Sound.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Audio/Debug/Leaks.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Extensions />
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_layout_file>
|
||||||
|
<ActiveTarget name="DebugStatic" />
|
||||||
|
</CodeBlocks_layout_file>
|
||||||
|
|
@ -0,0 +1,181 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="NazaraCore" />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="DebugStatic">
|
||||||
|
<Option output="..\lib\libNazaraCored-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option working_dir="" />
|
||||||
|
<Option object_output="obj\DebugStatic\NazaraCore" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add directory="..\include" />
|
||||||
|
<Add directory="..\src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add directory="..\lib" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseStatic">
|
||||||
|
<Option output="..\lib\libNazaraCore-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option working_dir="" />
|
||||||
|
<Option object_output="obj\ReleaseStatic\NazaraCore" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add directory="..\include" />
|
||||||
|
<Add directory="..\src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add directory="..\lib" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="DebugDLL">
|
||||||
|
<Option output="..\lib\NazaraCored.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj\DebugDLL\NazaraCore" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add directory="..\include" />
|
||||||
|
<Add directory="..\src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option='-Wl,--out-implib="../lib/libNazaraCored.a"' />
|
||||||
|
<Add directory="..\lib" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseDLL">
|
||||||
|
<Option output="..\lib\NazaraCore.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj\ReleaseDLL\NazaraCore" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add directory="..\include" />
|
||||||
|
<Add directory="..\src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option='-Wl,--out-implib="../lib/libNazaraCore.a"' />
|
||||||
|
<Add directory="..\lib" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Unit filename="..\include\Nazara\Core\ByteArray.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Clock.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Config.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Debug.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\DebugOff.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Debug\MemoryLeakTracker.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Directory.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\DynLib.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Endianness.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Endianness.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Error.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\File.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Format.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Hash.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\HashDigest.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\HashImpl.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Hash\CRC32.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Hash\Fletcher16.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Hash\MD5.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Hash\Whirlpool.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Hashable.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Lock.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Log.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Mutex.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Semaphore.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\String.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\StringStream.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Thread.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Thread.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\ThreadCondition.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\ThreadSafety.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Core\Unicode.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Basic.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Basic.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Config.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\EulerAngles.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\EulerAngles.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Matrix4.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Matrix4.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Quaternion.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Quaternion.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Vector2.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Vector2.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Vector3.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Vector3.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Vector4.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Math\Vector4.inl" />
|
||||||
|
<Unit filename="..\include\Nazara\Prerequesites.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\ByteArray.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Clock.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Debug\Leaks.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Debug\MemoryLeakTracker.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Directory.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\DynLib.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Error.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\File.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Hash.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\HashDigest.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Hash\CRC32.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Hash\Fletcher16.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Hash\MD5.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Hash\Whirlpool.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Hashable.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Lock.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Log.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Mutex.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Semaphore.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\String.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\StringStream.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Thread.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\ThreadCondition.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Unicode.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\ClockImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\ClockImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\DirectoryImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\DirectoryImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\DynLibImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\DynLibImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\FileImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\FileImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\MutexImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\MutexImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\SemaphoreImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\SemaphoreImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\ThreadConditionImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\ThreadConditionImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\ThreadImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\ThreadImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Core\Win32\Time.hpp" />
|
||||||
|
<Extensions>
|
||||||
|
<code_completion />
|
||||||
|
<envvars />
|
||||||
|
<debugger />
|
||||||
|
</Extensions>
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,139 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_layout_file>
|
||||||
|
<ActiveTarget name="DebugDLL" />
|
||||||
|
<File name="..\include\Nazara\Core\String.hpp" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="324" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Vector4.inl" open="0" top="0" tabpos="19" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="241" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\ThreadCondition.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="933" topLine="20" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Vector4.hpp" open="0" top="0" tabpos="22" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="272" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\ByteArray.hpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1447" topLine="29" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Vector3.inl" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="465" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\Log.hpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1036" topLine="27" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\StringStream.cpp" open="0" top="0" tabpos="37" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="4036" topLine="3" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\Clock.hpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="238" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Vector3.hpp" open="0" top="0" tabpos="21" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="272" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\String.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="374" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\Config.hpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1452" topLine="33" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Vector2.inl" open="0" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="241" topLine="2" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\Hashable.hpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="491" topLine="11" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\Debug.hpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="435" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Vector2.hpp" open="0" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="277" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Quaternion.inl" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="3754" topLine="163" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\Log.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="430" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Quaternion.hpp" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1402" topLine="21" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Matrix4.inl" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="15783" topLine="518" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\DynLib.hpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="885" topLine="17" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Matrix4.hpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="2811" topLine="54" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\EulerAngles.inl" open="0" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="2845" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\HashDigest.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="3421" topLine="137" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\EulerAngles.hpp" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="321" topLine="6" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\Error.hpp" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="878" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Config.hpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1596" topLine="4" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\Win32\MutexImpl.cpp" open="0" top="0" tabpos="36" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="491" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\File.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="11384" topLine="592" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\File.hpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="2102" topLine="61" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Basic.inl" open="0" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="331" topLine="253" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\Error.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="908" topLine="18" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Math\Basic.hpp" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="625" topLine="22" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\Win32\FileImpl.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="2049" topLine="88" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\DynLib.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1522" topLine="58" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\HashDigest.hpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="831" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\ThreadSafety.hpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1353" topLine="8" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\Win32\DynLibImpl.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="636" topLine="3" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\ThreadCondition.hpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="640" topLine="7" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\Clock.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="469" topLine="66" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\Thread.hpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1400" topLine="27" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\ByteArray.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="714" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Core\StringStream.hpp" open="0" top="0" tabpos="38" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1633" topLine="18" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Core\Win32\ClockImpl.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="747" topLine="14" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Prerequesites.hpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1733" topLine="40" />
|
||||||
|
</File>
|
||||||
|
</CodeBlocks_layout_file>
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="NazaraNetwork" />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="DebugStatic">
|
||||||
|
<Option output="../lib/libNazaraNetworkd-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/DebugStatic/NazaraNetwork" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCored-s" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseStatic">
|
||||||
|
<Option output="../lib/libNazaraNetwork-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/ReleaseStatic/NazaraNetwork" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCore-s" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="DebugDLL">
|
||||||
|
<Option output="../lib/NazaraNetworkd.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/DebugDLL/NazaraNetwork" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createDefFile="0" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option="-Wl,--out-implib="../lib/libNazaraNetworkd.a"" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCored" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseDLL">
|
||||||
|
<Option output="../lib/NazaraNetwork.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/ReleaseDLL/NazaraNetwork" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createDefFile="0" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option="-Wl,--out-implib="../lib/libNazaraNetwork.a"" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCore" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Unit filename="../include/Nazara/Network/Config.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Network/Debug.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Network/DebugOff.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Network/Debug/Leaks.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Extensions />
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_layout_file>
|
||||||
|
<ActiveTarget name="ReleaseDLL" />
|
||||||
|
</CodeBlocks_layout_file>
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="NazaraRenderer" />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="DebugStatic">
|
||||||
|
<Option output="..\lib\libNazaraRendererd-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option working_dir="" />
|
||||||
|
<Option object_output="obj\DebugStatic\NazaraRenderer" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add option="-DNAZARA_RENDERER_OPENGL" />
|
||||||
|
<Add directory="..\include" />
|
||||||
|
<Add directory="..\src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add library="gdi32" />
|
||||||
|
<Add library="opengl32" />
|
||||||
|
<Add library="winmm" />
|
||||||
|
<Add library="NazaraCored-s" />
|
||||||
|
<Add library="NazaraUtilityd-s" />
|
||||||
|
<Add directory="..\lib" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseStatic">
|
||||||
|
<Option output="..\lib\libNazaraRenderer-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option working_dir="" />
|
||||||
|
<Option object_output="obj\ReleaseStatic\NazaraRenderer" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add option="-DNAZARA_RENDERER_OPENGL" />
|
||||||
|
<Add directory="..\include" />
|
||||||
|
<Add directory="..\src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add library="gdi32" />
|
||||||
|
<Add library="opengl32" />
|
||||||
|
<Add library="winmm" />
|
||||||
|
<Add library="NazaraCore-s" />
|
||||||
|
<Add library="NazaraUtility-s" />
|
||||||
|
<Add directory="..\lib" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="DebugDLL">
|
||||||
|
<Option output="..\lib\NazaraRendererd.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj\DebugDLL\NazaraRenderer" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add option="-DNAZARA_RENDERER_OPENGL" />
|
||||||
|
<Add directory="..\include" />
|
||||||
|
<Add directory="..\src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option='-Wl,--out-implib="../lib/libNazaraRendererd.a"' />
|
||||||
|
<Add library="gdi32" />
|
||||||
|
<Add library="opengl32" />
|
||||||
|
<Add library="winmm" />
|
||||||
|
<Add library="NazaraCored" />
|
||||||
|
<Add library="NazaraUtilityd" />
|
||||||
|
<Add directory="..\lib" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseDLL">
|
||||||
|
<Option output="..\lib\NazaraRenderer.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj\ReleaseDLL\NazaraRenderer" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_RENDERER_OPENGL" />
|
||||||
|
<Add directory="..\include" />
|
||||||
|
<Add directory="..\src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option='-Wl,--out-implib="../lib/libNazaraRenderer.a"' />
|
||||||
|
<Add library="gdi32" />
|
||||||
|
<Add library="opengl32" />
|
||||||
|
<Add library="winmm" />
|
||||||
|
<Add library="NazaraCore" />
|
||||||
|
<Add library="NazaraUtility" />
|
||||||
|
<Add directory="..\lib" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\Buffer.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\Config.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\Context.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\ContextParameters.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\Debug.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\DebugOff.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\IndexBuffer.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\OpenGL.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\RenderTarget.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\RenderTargetParameters.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\RenderWindow.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\Renderer.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\Shader.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\VertexBuffer.hpp" />
|
||||||
|
<Unit filename="..\include\Nazara\Renderer\VertexDeclaration.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\Buffer.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\BufferImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\BufferImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\Context.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\ContextParameters.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\Debug\Leaks.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\GLSLShader.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\GLSLShader.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\HardwareBuffer.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\HardwareBuffer.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\IndexBuffer.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\OpenGL.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\RenderTarget.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\RenderWindow.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\Renderer.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\Shader.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\ShaderImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\ShaderImpl.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\SoftwareBuffer.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\SoftwareBuffer.hpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\VertexBuffer.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\VertexDeclaration.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\Win32\ContextImpl.cpp" />
|
||||||
|
<Unit filename="..\src\Nazara\Renderer\Win32\ContextImpl.hpp" />
|
||||||
|
<Extensions>
|
||||||
|
<code_completion />
|
||||||
|
<envvars />
|
||||||
|
<debugger />
|
||||||
|
</Extensions>
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,115 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_layout_file>
|
||||||
|
<ActiveTarget name="ReleaseDLL" />
|
||||||
|
<File name="..\include\Nazara\Renderer\Buffer.hpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1742" topLine="41" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\Context.cpp" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1193" topLine="29" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\BufferImpl.hpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="641" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\Win32\ContextImpl.hpp" open="1" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="549" topLine="7" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\BufferImpl.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="228" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\Win32\ContextImpl.cpp" open="1" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="7044" topLine="231" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\Buffer.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="3464" topLine="155" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\VertexDeclaration.cpp" open="1" top="0" tabpos="22" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="3228" topLine="100" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\VertexDeclaration.hpp" open="1" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="280" topLine="31" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\VertexBuffer.cpp" open="0" top="0" tabpos="23" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1254" topLine="37" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\VertexBuffer.hpp" open="1" top="0" tabpos="21" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="0" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\SoftwareBuffer.hpp" open="1" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="907" topLine="4" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\Shader.hpp" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1283" topLine="40" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\SoftwareBuffer.cpp" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1895" topLine="72" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\Renderer.hpp" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1271" topLine="33" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\ShaderImpl.hpp" open="1" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="885" topLine="8" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\ShaderImpl.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="255" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\Shader.cpp" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="6828" topLine="365" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\Renderer.cpp" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1721" topLine="72" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\RenderWindow.hpp" open="0" top="0" tabpos="26" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1264" topLine="19" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\RenderWindow.cpp" open="0" top="0" tabpos="27" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="3186" topLine="114" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\RenderTargetParameters.hpp" open="0" top="0" tabpos="28" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="342" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\RenderTarget.cpp" open="0" top="0" tabpos="25" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="654" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\RenderTarget.hpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="845" topLine="2" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\OpenGL.cpp" open="1" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1261" topLine="37" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\OpenGL.hpp" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="2028" topLine="56" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\IndexBuffer.cpp" open="1" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1580" topLine="24" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\IndexBuffer.hpp" open="0" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1074" topLine="3" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\HardwareBuffer.hpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="524" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\HardwareBuffer.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="5665" topLine="99" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\Debug.hpp" open="0" top="0" tabpos="22" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="443" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\GLSLShader.hpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1434" topLine="20" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\ContextParameters.hpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="783" topLine="3" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\GLSLShader.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="4915" topLine="210" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\Context.hpp" open="1" top="0" tabpos="19" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="832" topLine="8" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Renderer\Config.hpp" open="1" top="0" tabpos="23" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1950" topLine="21" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Renderer\ContextParameters.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="385" topLine="0" />
|
||||||
|
</File>
|
||||||
|
</CodeBlocks_layout_file>
|
||||||
|
|
@ -0,0 +1,147 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="NazaraUtility" />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="DebugStatic">
|
||||||
|
<Option output="../lib/libNazaraUtilityd-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/DebugStatic/NazaraUtility" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCored-s" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseStatic">
|
||||||
|
<Option output="../lib/libNazaraUtility-s.a" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/ReleaseStatic/NazaraUtility" />
|
||||||
|
<Option type="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_STATIC" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCore-s" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="DebugDLL">
|
||||||
|
<Option output="../lib/NazaraUtilityd.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/DebugDLL/NazaraUtility" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createDefFile="0" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add option="-DNAZARA_DEBUG" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option="-Wl,--out-implib="../lib/libNazaraUtilityd.a"" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCored" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="ReleaseDLL">
|
||||||
|
<Option output="../lib/NazaraUtility.dll" prefix_auto="0" extension_auto="0" />
|
||||||
|
<Option object_output="obj/ReleaseDLL/NazaraUtility" />
|
||||||
|
<Option type="3" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Option createDefFile="0" />
|
||||||
|
<Option createStaticLib="1" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
<Add option="-O3" />
|
||||||
|
<Add option="-DNAZARA_BUILD" />
|
||||||
|
<Add directory="../include" />
|
||||||
|
<Add directory="../src" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add option="-shared" />
|
||||||
|
<Add option="-Wl,--out-implib="../lib/libNazaraUtility.a"" />
|
||||||
|
<Add directory="../lib" />
|
||||||
|
<Add library="NazaraCore" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Config.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Debug.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/DebugOff.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Event.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Functor.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Keyboard.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Mouse.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/NonCopyable.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Resource.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Tuple.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/VideoMode.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Window.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/WindowHandle.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Functor.inl">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../include/Nazara/Utility/Tuple.inl">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/VideoModeImpl.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Win32/InputImpl.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Win32/WindowImpl.hpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Keyboard.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Mouse.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Resource.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/VideoMode.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Window.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Debug/Leaks.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Win32/InputImpl.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Win32/VideoModeImpl.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="../src/Nazara/Utility/Win32/WindowImpl.cpp">
|
||||||
|
</Unit>
|
||||||
|
<Extensions />
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,686 @@
|
||||||
|
# depslib dependency file v1.0
|
||||||
|
1334324905 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\windowimpl.cpp
|
||||||
|
<Nazara/Utility/Win32/WindowImpl.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
<Nazara/Core/Thread.hpp>
|
||||||
|
<Nazara/Core/ThreadCondition.hpp>
|
||||||
|
<cstdio>
|
||||||
|
<windowsx.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1334313580 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\windowimpl.hpp
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/Window.hpp>
|
||||||
|
<windows.h>
|
||||||
|
|
||||||
|
1333794423 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\string.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/Hashable.hpp>
|
||||||
|
<Nazara/Core/ThreadSafety.hpp>
|
||||||
|
<istream>
|
||||||
|
<ostream>
|
||||||
|
<string>
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1329769188 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\prerequesites.hpp
|
||||||
|
<cstdint>
|
||||||
|
|
||||||
|
1325573352 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\hashable.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1332429717 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\threadsafety.hpp
|
||||||
|
<Nazara/Core/Config.hpp>
|
||||||
|
<Nazara/Core/Lock.hpp>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
|
||||||
|
1334410813 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\config.hpp
|
||||||
|
|
||||||
|
1326821312 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\lock.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1329768326 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\mutex.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
1329768566 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\noncopyable.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1334772468 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\math\vector2.hpp
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Vector2.inl>
|
||||||
|
|
||||||
|
1334861874 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\math\config.hpp
|
||||||
|
|
||||||
|
1334772466 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\math\vector2.inl
|
||||||
|
<Nazara/Core/StringStream.hpp>
|
||||||
|
<Nazara/Math/Basic.hpp>
|
||||||
|
<cmath>
|
||||||
|
<cstdlib>
|
||||||
|
<stdexcept>
|
||||||
|
<Nazara/Core/Debug.hpp>
|
||||||
|
<Nazara/Core/DebugOff.hpp>
|
||||||
|
|
||||||
|
1335459002 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\stringstream.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Core/ThreadSafety.hpp>
|
||||||
|
<string>
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1335517151 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\debug.hpp
|
||||||
|
<Nazara/Core/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
1331674200 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\debug\memoryleaktracker.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<cstdio>
|
||||||
|
<cstring>
|
||||||
|
|
||||||
|
1329933502 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\debugoff.hpp
|
||||||
|
|
||||||
|
1330631838 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\config.hpp
|
||||||
|
|
||||||
|
1330715244 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\keyboard.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1334326021 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\mouse.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
|
||||||
|
1329408522 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\videomode.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1332336268 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\window.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Utility/Event.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/WindowHandle.hpp>
|
||||||
|
<queue>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
<Nazara/Core/ThreadCondition.hpp>
|
||||||
|
|
||||||
|
1331039152 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\event.hpp
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
|
||||||
|
1330966870 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\windowhandle.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1326821312 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\threadcondition.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1329930704 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\error.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
1331679934 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\thread.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/Functor.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Core/Thread.inl>
|
||||||
|
|
||||||
|
1328217374 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\functor.hpp
|
||||||
|
<Nazara/Utility/Tuple.hpp>
|
||||||
|
<Nazara/Utility/Functor.inl>
|
||||||
|
|
||||||
|
1328217378 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\tuple.hpp
|
||||||
|
<tuple>
|
||||||
|
<Nazara/Utility/Tuple.inl>
|
||||||
|
|
||||||
|
1332008740 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\tuple.inl
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
<Nazara/Utility/DebugOff.hpp>
|
||||||
|
|
||||||
|
1329944648 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\debug.hpp
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
1329933512 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\debugoff.hpp
|
||||||
|
|
||||||
|
1327876196 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\functor.inl
|
||||||
|
|
||||||
|
1327875186 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\core\thread.inl
|
||||||
|
<Nazara/Core/Debug.hpp>
|
||||||
|
<Nazara/Core/DebugOff.hpp>
|
||||||
|
|
||||||
|
1330694346 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\videomodeimpl.cpp
|
||||||
|
<Nazara/Utility/VideoModeImpl.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<algorithm>
|
||||||
|
<windows.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1329408376 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\videomodeimpl.hpp
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1334327014 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\inputimpl.cpp
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Utility/Window.hpp>
|
||||||
|
<windows.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1334326179 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\inputimpl.hpp
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
|
||||||
|
1329944564 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\debug\leaks.cpp
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
<new>
|
||||||
|
|
||||||
|
1334249419 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\window.cpp
|
||||||
|
<Nazara/Utility/Window.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Core/Lock.hpp>
|
||||||
|
<stdexcept>
|
||||||
|
<Nazara/Utility/Win32/WindowImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/WindowImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1329933674 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\videomode.cpp
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/VideoModeImpl.hpp>
|
||||||
|
<algorithm>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1332918105 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\resource.cpp
|
||||||
|
<Nazara/Utility/Resource.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
|
||||||
|
1330634000 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\utility\resource.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
1334394002 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\mouse.cpp
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1330992228 source:c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\src\nazara\utility\keyboard.cpp
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1330630392 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\resource.cpp
|
||||||
|
<Nazara/Utility/Resource.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
|
||||||
|
1330630400 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\resource.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
1329765588 e:\programmation\digitalpulse software\nazara engine\include\nazara\prerequesites.hpp
|
||||||
|
<cstdint>
|
||||||
|
|
||||||
|
1329764966 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\noncopyable.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1329927104 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\error.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
1330819758 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\string.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/Hashable.hpp>
|
||||||
|
<Nazara/Core/ThreadSafety.hpp>
|
||||||
|
<istream>
|
||||||
|
<ostream>
|
||||||
|
<string>
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1325569752 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\hashable.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1330587992 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\threadsafety.hpp
|
||||||
|
<Nazara/Core/Config.hpp>
|
||||||
|
<Nazara/Core/Lock.hpp>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
|
||||||
|
1331468620 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\config.hpp
|
||||||
|
|
||||||
|
1326817712 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\lock.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1329764726 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\mutex.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
1330628238 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\config.hpp
|
||||||
|
|
||||||
|
1330988624 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\mouse.cpp
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1329593638 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\mouse.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
|
||||||
|
1329588004 e:\programmation\digitalpulse software\nazara engine\include\nazara\math\vector2.hpp
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Config.hpp>
|
||||||
|
<Nazara/Math/Vector2.inl>
|
||||||
|
|
||||||
|
1329588840 e:\programmation\digitalpulse software\nazara engine\include\nazara\math\config.hpp
|
||||||
|
|
||||||
|
1329593976 e:\programmation\digitalpulse software\nazara engine\include\nazara\math\vector2.inl
|
||||||
|
<Nazara/Core/StringStream.hpp>
|
||||||
|
<cmath>
|
||||||
|
<cstdlib>
|
||||||
|
<limits>
|
||||||
|
<stdexcept>
|
||||||
|
<Nazara/Core/Debug.hpp>
|
||||||
|
<Nazara/Core/DebugOff.hpp>
|
||||||
|
|
||||||
|
1329765574 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\stringstream.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<string>
|
||||||
|
<vector>
|
||||||
|
<Nazara/Core/ThreadSafety.hpp>
|
||||||
|
|
||||||
|
1329941040 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\debug.hpp
|
||||||
|
<Nazara/Core/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
1331670600 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\debug\memoryleaktracker.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<cstdio>
|
||||||
|
<cstring>
|
||||||
|
|
||||||
|
1329929902 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\debugoff.hpp
|
||||||
|
|
||||||
|
1330046070 e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\inputimpl.hpp
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
|
||||||
|
1330711644 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\keyboard.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1329941048 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\debug.hpp
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
1330988628 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\keyboard.cpp
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1331107190 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\windowimpl.cpp
|
||||||
|
<Nazara/Utility/Win32/WindowImpl.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
<Nazara/Core/Thread.hpp>
|
||||||
|
<Nazara/Core/ThreadCondition.hpp>
|
||||||
|
<cstdio>
|
||||||
|
<windowsx.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1330983934 e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\windowimpl.hpp
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/Window.hpp>
|
||||||
|
<windows.h>
|
||||||
|
|
||||||
|
1329404922 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\videomode.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1330983882 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\window.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Utility/Event.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/WindowHandle.hpp>
|
||||||
|
<queue>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
<Nazara/Core/ThreadCondition.hpp>
|
||||||
|
|
||||||
|
1331035552 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\event.hpp
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
|
||||||
|
1330963270 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\windowhandle.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1326817712 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\threadcondition.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1331676334 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\thread.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/Functor.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Core/Thread.inl>
|
||||||
|
|
||||||
|
1328213774 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\functor.hpp
|
||||||
|
<Nazara/Utility/Tuple.hpp>
|
||||||
|
<Nazara/Utility/Functor.inl>
|
||||||
|
|
||||||
|
1328213778 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\tuple.hpp
|
||||||
|
<tuple>
|
||||||
|
<Nazara/Utility/Tuple.inl>
|
||||||
|
|
||||||
|
1332005140 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\tuple.inl
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
<Nazara/Utility/DebugOff.hpp>
|
||||||
|
|
||||||
|
1329929912 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\debugoff.hpp
|
||||||
|
|
||||||
|
1327872596 e:\programmation\digitalpulse software\nazara engine\include\nazara\utility\functor.inl
|
||||||
|
|
||||||
|
1327871586 e:\programmation\digitalpulse software\nazara engine\include\nazara\core\thread.inl
|
||||||
|
<Nazara/Core/Debug.hpp>
|
||||||
|
<Nazara/Core/DebugOff.hpp>
|
||||||
|
|
||||||
|
1330690746 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\videomodeimpl.cpp
|
||||||
|
<Nazara/Utility/VideoModeImpl.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<algorithm>
|
||||||
|
<windows.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1329404776 e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\videomodeimpl.hpp
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1330051962 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\win32\inputimpl.cpp
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<windows.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1329940964 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\debug\leaks.cpp
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
<new>
|
||||||
|
|
||||||
|
1330988890 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\window.cpp
|
||||||
|
<Nazara/Utility/Window.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Core/Lock.hpp>
|
||||||
|
<Nazara/Utility/Win32/WindowImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/WindowImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1329930074 source:e:\programmation\digitalpulse software\nazara engine\src\nazara\utility\videomode.cpp
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/VideoModeImpl.hpp>
|
||||||
|
<algorithm>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1329944564 source:e:\digitalpulse software\nazara engine\src\nazara\utility\debug\leaks.cpp
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
<new>
|
||||||
|
|
||||||
|
1330631838 e:\digitalpulse software\nazara engine\include\nazara\utility\config.hpp
|
||||||
|
|
||||||
|
1331674200 e:\digitalpulse software\nazara engine\include\nazara\core\debug\memoryleaktracker.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<cstdio>
|
||||||
|
<cstring>
|
||||||
|
|
||||||
|
1329769188 e:\digitalpulse software\nazara engine\include\nazara\prerequesites.hpp
|
||||||
|
<cstdint>
|
||||||
|
|
||||||
|
1334249419 source:e:\digitalpulse software\nazara engine\src\nazara\utility\window.cpp
|
||||||
|
<Nazara/Utility/Window.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Core/Lock.hpp>
|
||||||
|
<stdexcept>
|
||||||
|
<Nazara/Utility/Win32/WindowImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/WindowImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1332336268 e:\digitalpulse software\nazara engine\include\nazara\utility\window.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Utility/Event.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/WindowHandle.hpp>
|
||||||
|
<queue>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
<Nazara/Core/ThreadCondition.hpp>
|
||||||
|
|
||||||
|
1333794423 e:\digitalpulse software\nazara engine\include\nazara\core\string.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/Hashable.hpp>
|
||||||
|
<Nazara/Core/ThreadSafety.hpp>
|
||||||
|
<istream>
|
||||||
|
<ostream>
|
||||||
|
<string>
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1325573352 e:\digitalpulse software\nazara engine\include\nazara\core\hashable.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1332429717 e:\digitalpulse software\nazara engine\include\nazara\core\threadsafety.hpp
|
||||||
|
<Nazara/Core/Config.hpp>
|
||||||
|
<Nazara/Core/Lock.hpp>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
|
||||||
|
1334410813 e:\digitalpulse software\nazara engine\include\nazara\core\config.hpp
|
||||||
|
|
||||||
|
1326821312 e:\digitalpulse software\nazara engine\include\nazara\core\lock.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1329768326 e:\digitalpulse software\nazara engine\include\nazara\core\mutex.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
1329768566 e:\digitalpulse software\nazara engine\include\nazara\utility\noncopyable.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1334772468 e:\digitalpulse software\nazara engine\include\nazara\math\vector2.hpp
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Vector2.inl>
|
||||||
|
|
||||||
|
1334861597 e:\digitalpulse software\nazara engine\include\nazara\math\config.hpp
|
||||||
|
|
||||||
|
1334772466 e:\digitalpulse software\nazara engine\include\nazara\math\vector2.inl
|
||||||
|
<Nazara/Core/StringStream.hpp>
|
||||||
|
<Nazara/Math/Basic.hpp>
|
||||||
|
<cmath>
|
||||||
|
<cstdlib>
|
||||||
|
<stdexcept>
|
||||||
|
<Nazara/Core/Debug.hpp>
|
||||||
|
<Nazara/Core/DebugOff.hpp>
|
||||||
|
|
||||||
|
1332508516 e:\digitalpulse software\nazara engine\include\nazara\core\stringstream.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Core/ThreadSafety.hpp>
|
||||||
|
<string>
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1329944640 e:\digitalpulse software\nazara engine\include\nazara\core\debug.hpp
|
||||||
|
<Nazara/Core/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
1329933502 e:\digitalpulse software\nazara engine\include\nazara\core\debugoff.hpp
|
||||||
|
|
||||||
|
1331039152 e:\digitalpulse software\nazara engine\include\nazara\utility\event.hpp
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
|
||||||
|
1330715244 e:\digitalpulse software\nazara engine\include\nazara\utility\keyboard.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1334326021 e:\digitalpulse software\nazara engine\include\nazara\utility\mouse.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
|
||||||
|
1329408522 e:\digitalpulse software\nazara engine\include\nazara\utility\videomode.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1330966870 e:\digitalpulse software\nazara engine\include\nazara\utility\windowhandle.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1326821312 e:\digitalpulse software\nazara engine\include\nazara\core\threadcondition.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
1329930704 e:\digitalpulse software\nazara engine\include\nazara\core\error.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
1334313580 e:\digitalpulse software\nazara engine\src\nazara\utility\win32\windowimpl.hpp
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/Window.hpp>
|
||||||
|
<windows.h>
|
||||||
|
|
||||||
|
1329944648 e:\digitalpulse software\nazara engine\include\nazara\utility\debug.hpp
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
<Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
1329933674 source:e:\digitalpulse software\nazara engine\src\nazara\utility\videomode.cpp
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<Nazara/Utility/VideoModeImpl.hpp>
|
||||||
|
<algorithm>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1329408376 e:\digitalpulse software\nazara engine\src\nazara\utility\videomodeimpl.hpp
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1332918105 source:e:\digitalpulse software\nazara engine\src\nazara\utility\resource.cpp
|
||||||
|
<Nazara/Utility/Resource.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Utility/Config.hpp>
|
||||||
|
|
||||||
|
1330634000 e:\digitalpulse software\nazara engine\include\nazara\utility\resource.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
1334394002 source:e:\digitalpulse software\nazara engine\src\nazara\utility\mouse.cpp
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1334326179 e:\digitalpulse software\nazara engine\src\nazara\utility\win32\inputimpl.hpp
|
||||||
|
<Nazara/Math/Vector2.hpp>
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Mouse.hpp>
|
||||||
|
|
||||||
|
1330992228 source:e:\digitalpulse software\nazara engine\src\nazara\utility\keyboard.cpp
|
||||||
|
<Nazara/Utility/Keyboard.hpp>
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Linux/InputImpl.hpp>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1334324905 source:e:\digitalpulse software\nazara engine\src\nazara\utility\win32\windowimpl.cpp
|
||||||
|
<Nazara/Utility/Win32/WindowImpl.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Core/Mutex.hpp>
|
||||||
|
<Nazara/Core/Thread.hpp>
|
||||||
|
<Nazara/Core/ThreadCondition.hpp>
|
||||||
|
<cstdio>
|
||||||
|
<windowsx.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1331679934 e:\digitalpulse software\nazara engine\include\nazara\core\thread.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Utility/Functor.hpp>
|
||||||
|
<Nazara/Utility/NonCopyable.hpp>
|
||||||
|
<Nazara/Core/Thread.inl>
|
||||||
|
|
||||||
|
1328217374 e:\digitalpulse software\nazara engine\include\nazara\utility\functor.hpp
|
||||||
|
<Nazara/Utility/Tuple.hpp>
|
||||||
|
<Nazara/Utility/Functor.inl>
|
||||||
|
|
||||||
|
1328217378 e:\digitalpulse software\nazara engine\include\nazara\utility\tuple.hpp
|
||||||
|
<tuple>
|
||||||
|
<Nazara/Utility/Tuple.inl>
|
||||||
|
|
||||||
|
1332008740 e:\digitalpulse software\nazara engine\include\nazara\utility\tuple.inl
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
<Nazara/Utility/DebugOff.hpp>
|
||||||
|
|
||||||
|
1329933512 e:\digitalpulse software\nazara engine\include\nazara\utility\debugoff.hpp
|
||||||
|
|
||||||
|
1327876196 e:\digitalpulse software\nazara engine\include\nazara\utility\functor.inl
|
||||||
|
|
||||||
|
1327875186 e:\digitalpulse software\nazara engine\include\nazara\core\thread.inl
|
||||||
|
<Nazara/Core/Debug.hpp>
|
||||||
|
<Nazara/Core/DebugOff.hpp>
|
||||||
|
|
||||||
|
1330694346 source:e:\digitalpulse software\nazara engine\src\nazara\utility\win32\videomodeimpl.cpp
|
||||||
|
<Nazara/Utility/VideoModeImpl.hpp>
|
||||||
|
<Nazara/Utility/VideoMode.hpp>
|
||||||
|
<algorithm>
|
||||||
|
<windows.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1334327014 source:e:\digitalpulse software\nazara engine\src\nazara\utility\win32\inputimpl.cpp
|
||||||
|
<Nazara/Utility/Win32/InputImpl.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Utility/Window.hpp>
|
||||||
|
<windows.h>
|
||||||
|
<Nazara/Utility/Debug.hpp>
|
||||||
|
|
||||||
|
1334778394 e:\digitalpulse software\nazara engine\include\nazara\math\basic.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/Config.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Basic.inl>
|
||||||
|
|
||||||
|
1334780246 e:\digitalpulse software\nazara engine\include\nazara\math\basic.inl
|
||||||
|
<Nazara/Core/Debug.hpp>
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Math/Config.hpp>
|
||||||
|
<algorithm>
|
||||||
|
<cmath>
|
||||||
|
<cstring>
|
||||||
|
<Nazara/Core/DebugOff.hpp>
|
||||||
|
|
||||||
|
1334778394 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\math\basic.hpp
|
||||||
|
<Nazara/Prerequesites.hpp>
|
||||||
|
<Nazara/Core/Config.hpp>
|
||||||
|
<Nazara/Core/String.hpp>
|
||||||
|
<Nazara/Math/Basic.inl>
|
||||||
|
|
||||||
|
1335518274 c:\users\lynix\documents\programmation\digitalpulse software\nazara engine\include\nazara\math\basic.inl
|
||||||
|
<Nazara/Core/Error.hpp>
|
||||||
|
<Nazara/Math/Config.hpp>
|
||||||
|
<algorithm>
|
||||||
|
<cmath>
|
||||||
|
<cstring>
|
||||||
|
<Nazara/Core/Debug.hpp>
|
||||||
|
<Nazara/Core/DebugOff.hpp>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_layout_file>
|
||||||
|
<ActiveTarget name="ReleaseDLL" />
|
||||||
|
<File name="..\src\Nazara\Utility\Win32\WindowImpl.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="4321" topLine="161" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Utility\Win32\InputImpl.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="5177" topLine="172" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Utility\Window.hpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1469" topLine="30" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Utility\Window.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="3931" topLine="185" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Utility\VideoMode.hpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="0" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Utility\Tuple.hpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="256" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Utility\Resource.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="417" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Utility\Resource.hpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="0" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Utility\Mouse.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="1096" topLine="14" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Utility\Keyboard.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="567" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Utility\Mouse.hpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="896" topLine="3" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Utility\Win32\WindowImpl.hpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="2700" topLine="65" />
|
||||||
|
</File>
|
||||||
|
<File name="..\src\Nazara\Utility\Win32\InputImpl.hpp" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="730" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="..\include\Nazara\Utility\Tuple.inl" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor1 position="875" topLine="7" />
|
||||||
|
</File>
|
||||||
|
</CodeBlocks_layout_file>
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
premake4 parseunicode
|
||||||
|
pause
|
||||||
|
|
@ -0,0 +1,197 @@
|
||||||
|
local CategoryToString = {}
|
||||||
|
CategoryToString["C"] = "Category_Other"
|
||||||
|
CategoryToString["Cc"] = "Category_Other_Control"
|
||||||
|
CategoryToString["Cf"] = "Category_Other_Format"
|
||||||
|
CategoryToString["Cn"] = "Category_Other_NotAssigned"
|
||||||
|
CategoryToString["Co"] = "Category_Other_PrivateUse"
|
||||||
|
CategoryToString["Cs"] = "Category_Other_Surrogate"
|
||||||
|
CategoryToString["L"] = "Category_Letter"
|
||||||
|
CategoryToString["Ll"] = "Category_Letter_Lowercase"
|
||||||
|
CategoryToString["Lm"] = "Category_Letter_Modifier"
|
||||||
|
CategoryToString["Lo"] = "Category_Letter_Other"
|
||||||
|
CategoryToString["Lt"] = "Category_Letter_Titlecase"
|
||||||
|
CategoryToString["Lu"] = "Category_Letter_Uppercase"
|
||||||
|
CategoryToString["M"] = "Category_Mark"
|
||||||
|
CategoryToString["Me"] = "Category_Mark_Enclosing"
|
||||||
|
CategoryToString["Mn"] = "Category_Mark_NonSpacing"
|
||||||
|
CategoryToString["Mc"] = "Category_Mark_SpacingCombining"
|
||||||
|
CategoryToString["N"] = "Category_Number"
|
||||||
|
CategoryToString["Nd"] = "Category_Number_DecimalDigit"
|
||||||
|
CategoryToString["Nl"] = "Category_Number_Letter"
|
||||||
|
CategoryToString["No"] = "Category_Number_Other"
|
||||||
|
CategoryToString["P"] = "Category_Punctuation"
|
||||||
|
CategoryToString["Pe"] = "Category_Punctuation_Close"
|
||||||
|
CategoryToString["Pc"] = "Category_Punctuation_Connector"
|
||||||
|
CategoryToString["Pd"] = "Category_Punctuation_Dash"
|
||||||
|
CategoryToString["Pf"] = "Category_Punctuation_FinalQuote"
|
||||||
|
CategoryToString["Pi"] = "Category_Punctuation_InitialQuote"
|
||||||
|
CategoryToString["Ps"] = "Category_Punctuation_Open"
|
||||||
|
CategoryToString["Po"] = "Category_Punctuation_Other"
|
||||||
|
CategoryToString["S"] = "Category_Symbol"
|
||||||
|
CategoryToString["Sc"] = "Category_Symbol_Currency"
|
||||||
|
CategoryToString["Sm"] = "Category_Symbol_Math"
|
||||||
|
CategoryToString["Sk"] = "Category_Symbol_Modifier"
|
||||||
|
CategoryToString["So"] = "Category_Symbol_Other"
|
||||||
|
CategoryToString["Z"] = "Category_Separator"
|
||||||
|
CategoryToString["Zl"] = "Category_Separator_Line"
|
||||||
|
CategoryToString["Zp"] = "Category_Separator_Paragraph"
|
||||||
|
CategoryToString["Zs"] = "Category_Separator_Space"
|
||||||
|
|
||||||
|
local DirectionToString = {}
|
||||||
|
DirectionToString["AL"] = "Direction_Arabic_Letter"
|
||||||
|
DirectionToString["AN"] = "Direction_Arabic_Number"
|
||||||
|
DirectionToString["BN"] = "Direction_Boundary_Neutral"
|
||||||
|
DirectionToString["CS"] = "Direction_Common_Separator"
|
||||||
|
DirectionToString["EN"] = "Direction_European_Number"
|
||||||
|
DirectionToString["ES"] = "Direction_European_Separator"
|
||||||
|
DirectionToString["ET"] = "Direction_European_Terminator"
|
||||||
|
DirectionToString["L"] = "Direction_Left_To_Right"
|
||||||
|
DirectionToString["LRE"] = "Direction_Left_To_Right_Embedding"
|
||||||
|
DirectionToString["LRO"] = "Direction_Left_To_Right_Override"
|
||||||
|
DirectionToString["NSM"] = "Direction_Nonspacing_Mark"
|
||||||
|
DirectionToString["ON"] = "Direction_Other_Neutral"
|
||||||
|
DirectionToString["B"] = "Direction_Paragraph_Separator"
|
||||||
|
DirectionToString["PDF"] = "Direction_Pop_Directional_Format"
|
||||||
|
DirectionToString["R"] = "Direction_Right_To_Left"
|
||||||
|
DirectionToString["RLE"] = "Direction_Right_To_Left_Embedding"
|
||||||
|
DirectionToString["RLO"] = "Direction_Right_To_Left_Override"
|
||||||
|
DirectionToString["S"] = "Direction_Segment_Separator"
|
||||||
|
DirectionToString["WS"] = "Direction_White_Space"
|
||||||
|
|
||||||
|
table.maxn = table.maxn or function (tab) -- Compatibilité Lua 5.2
|
||||||
|
local maxIndex = 0
|
||||||
|
for k,v in pairs(tab) do
|
||||||
|
if (k > maxIndex) then
|
||||||
|
maxIndex = k
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function getCharacter(tab, first, index)
|
||||||
|
local character = {}
|
||||||
|
character.Category = CategoryToString[tab[3]] or "Category_NoCategory"
|
||||||
|
character.Direction = DirectionToString[tab[5]] or error("Direction not recognized")
|
||||||
|
character.LowerCase = (string.len(tab[14]) ~= 0 and (tonumber(tab[14], 16)-first)) or index
|
||||||
|
character.UpperCase = (string.len(tab[13]) ~= 0 and (tonumber(tab[13], 16)-first)) or index
|
||||||
|
character.TitleCase = (string.len(tab[15]) ~= 0 and (tonumber(tab[15], 16)-first)) or character.UpperCase
|
||||||
|
|
||||||
|
return character
|
||||||
|
end
|
||||||
|
|
||||||
|
function parseUnicodeData()
|
||||||
|
local unicodeSet = {}
|
||||||
|
|
||||||
|
file = io.open ("scripts/data/UnicodeData.txt", "r")
|
||||||
|
if (not file) then
|
||||||
|
error("Unable to open Unicode Data file")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local t1 = os.clock()
|
||||||
|
print("Parsing UnicodeData.txt...")
|
||||||
|
local first = 0
|
||||||
|
local last = 0
|
||||||
|
unicodeSet[0] = {}
|
||||||
|
unicodeSet[0].First = 0
|
||||||
|
unicodeSet[0].Characters = {}
|
||||||
|
local currentSet = 0
|
||||||
|
local inblock = false
|
||||||
|
local blockData = nil
|
||||||
|
local unusedIndex = 0
|
||||||
|
local c = 0
|
||||||
|
for line in file:lines() do
|
||||||
|
local old = 0
|
||||||
|
local start = string.find(line, ';', old)
|
||||||
|
local tab = {}
|
||||||
|
while (start) do
|
||||||
|
tab[#tab+1] = string.sub(line, old, start-1, old)
|
||||||
|
old = start+1
|
||||||
|
start = string.find(line, ';', old)
|
||||||
|
end
|
||||||
|
tab[#tab+1] = string.sub(line, old)
|
||||||
|
|
||||||
|
local index = tonumber(tab[1], 16)
|
||||||
|
if (index > 0 and not inblock) then
|
||||||
|
if (index-last > 1000) then
|
||||||
|
unicodeSet[currentSet].Last = last
|
||||||
|
currentSet = currentSet + 1
|
||||||
|
unicodeSet[currentSet] = {}
|
||||||
|
unicodeSet[currentSet].First = index
|
||||||
|
unicodeSet[currentSet].Characters = {}
|
||||||
|
print("Set detected (Begin at " .. first .. ", end at " .. last .. ")")
|
||||||
|
first = index
|
||||||
|
else
|
||||||
|
unusedIndex = unusedIndex + index-last-1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local blockName, blockId = string.match(tab[2], "<(.+), (%w+)>")
|
||||||
|
if (blockName ~= nil and blockId ~= nil) then
|
||||||
|
if (blockId == "First") then
|
||||||
|
if (inblock) then
|
||||||
|
error("Already in block (" .. tab[1] .. ")")
|
||||||
|
end
|
||||||
|
inblock = true
|
||||||
|
blockCharacter = getCharacter(tab, first)
|
||||||
|
elseif (blockId == "Last") then
|
||||||
|
if (not inblock) then
|
||||||
|
error("Not in block (" .. tab[1] .. ")")
|
||||||
|
end
|
||||||
|
inblock = false
|
||||||
|
for i=first, index do
|
||||||
|
unicodeSet[currentSet].Characters[i] = getCharacter(tab, first, i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
unicodeSet[currentSet].Characters[index - first] = getCharacter(tab, first, index)
|
||||||
|
if (unicodeSet[currentSet].Characters[index - first].LowerCase ~= (index - first) or
|
||||||
|
unicodeSet[currentSet].Characters[index - first].UpperCase ~= (index - first) or
|
||||||
|
unicodeSet[currentSet].Characters[index - first].TitleCase ~= (index - first)) then
|
||||||
|
c = c + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
last = index
|
||||||
|
end
|
||||||
|
unicodeSet[currentSet].Last = last
|
||||||
|
print("Set detected (Begin at " .. first .. ", end at " .. last .. ")")
|
||||||
|
file:close()
|
||||||
|
|
||||||
|
print("Parsed " .. last+1 .. " characters in " .. #unicodeSet .. " sets, " .. unusedIndex .. " unused indices (took " .. os.difftime(os.clock(), t1) .. " sec)")
|
||||||
|
|
||||||
|
file = io.open("../src/Nazara/Core/UnicodeData.hpp", "w+")
|
||||||
|
if (not file) then
|
||||||
|
error("Unable to create Unicode Data header")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
print("Writting Unicode Data to header...")
|
||||||
|
|
||||||
|
t1 = os.clock()
|
||||||
|
for i=0, #unicodeSet do
|
||||||
|
local maxn = table.maxn(unicodeSet[i].Characters)
|
||||||
|
file:write(string.format("Character unicodeSet%d[%d] = {\n", i, maxn+1))
|
||||||
|
|
||||||
|
for j=0, maxn do
|
||||||
|
local v = unicodeSet[i].Characters[j]
|
||||||
|
if (v) then
|
||||||
|
file:write(string.format("\t{%s,%s,%d,%d,%d},\n", v.Category, v.Direction, v.LowerCase, v.TitleCase, v.UpperCase))
|
||||||
|
else
|
||||||
|
file:write(string.format("\t{Category_NoCategory,Direction_Boundary_Neutral,%d,%d,%d},\n", j, j, j))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
file:write("};\n\n")
|
||||||
|
end
|
||||||
|
file:close()
|
||||||
|
|
||||||
|
print("Took " .. os.difftime(os.clock(), t1) .. "sec.")
|
||||||
|
end
|
||||||
|
--print(string.match("<Plane 15 Private Use, First>", "<.+, (%w+)>"))
|
||||||
|
|
||||||
|
newaction
|
||||||
|
{
|
||||||
|
trigger = "unicode",
|
||||||
|
description = "Parse the Unicode Character Data and put the useful informations into a header",
|
||||||
|
execute = parseUnicodeData
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
-- Configuration générale
|
||||||
|
configurations
|
||||||
|
{
|
||||||
|
"DebugStatic",
|
||||||
|
"ReleaseStatic",
|
||||||
|
"DebugDLL",
|
||||||
|
"ReleaseDLL"
|
||||||
|
}
|
||||||
|
|
||||||
|
defines "NAZARA_BUILD"
|
||||||
|
language "C++"
|
||||||
|
includedirs
|
||||||
|
{
|
||||||
|
"../include",
|
||||||
|
"../src/"
|
||||||
|
}
|
||||||
|
libdirs "../lib"
|
||||||
|
targetdir "../lib"
|
||||||
|
|
||||||
|
configuration "Debug*"
|
||||||
|
defines "NAZARA_DEBUG"
|
||||||
|
flags "Symbols"
|
||||||
|
|
||||||
|
configuration "Release*"
|
||||||
|
flags { "Optimize", "OptimizeSpeed" }
|
||||||
|
|
||||||
|
configuration "*Static"
|
||||||
|
defines "NAZARA_STATIC"
|
||||||
|
kind "StaticLib"
|
||||||
|
targetsuffix "-s"
|
||||||
|
|
||||||
|
configuration "*DLL"
|
||||||
|
kind "SharedLib"
|
||||||
|
|
||||||
|
configuration { "linux or bsd or macosx", "gmake" }
|
||||||
|
buildoptions "-fvisibility=hidden"
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
project "NazaraAudio"
|
||||||
|
|
||||||
|
files
|
||||||
|
{
|
||||||
|
"../include/Nazara/Audio/**.hpp",
|
||||||
|
"../include/Nazara/Audio/**.inl",
|
||||||
|
"../src/Nazara/Audio/**.hpp",
|
||||||
|
"../src/Nazara/Audio/**.cpp"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os.is("windows")) then
|
||||||
|
excludes { "../src/Nazara/Audio/Posix/*.hpp", "../src/Nazara/Audio/Posix/*.cpp" }
|
||||||
|
else
|
||||||
|
excludes { "../src/Nazara/Audio/Win32/*.hpp", "../src/Nazara/Audio/Win32/*.cpp" }
|
||||||
|
end
|
||||||
|
|
||||||
|
configuration "DebugStatic"
|
||||||
|
links "NazaraCored-s"
|
||||||
|
targetname "NazaraAudiod"
|
||||||
|
|
||||||
|
configuration "ReleaseStatic"
|
||||||
|
links "NazaraCore-s"
|
||||||
|
targetname "NazaraAudio"
|
||||||
|
|
||||||
|
configuration "DebugDLL"
|
||||||
|
links "NazaraCored"
|
||||||
|
targetname "NazaraAudiod"
|
||||||
|
|
||||||
|
configuration "ReleaseDLL"
|
||||||
|
links "NazaraCore"
|
||||||
|
targetname "NazaraAudio"
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
project "NazaraCore"
|
||||||
|
|
||||||
|
files
|
||||||
|
{
|
||||||
|
"../include/Nazara/Prerequesites.hpp",
|
||||||
|
"../include/Nazara/Core/**.hpp",
|
||||||
|
"../include/Nazara/Core/**.inl",
|
||||||
|
"../src/Nazara/Core/**.hpp",
|
||||||
|
"../src/Nazara/Core/**.cpp"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os.is("windows")) then
|
||||||
|
excludes { "../src/Nazara/Core/Posix/**.hpp", "../src/Nazara/Core/Posix/**.cpp" }
|
||||||
|
else
|
||||||
|
excludes { "../src/Nazara/Core/Win32/**.hpp", "../src/Nazara/Core/Win32/**.cpp" }
|
||||||
|
end
|
||||||
|
|
||||||
|
configuration "Debug*"
|
||||||
|
targetname "NazaraCored"
|
||||||
|
|
||||||
|
configuration "Release*"
|
||||||
|
targetname "NazaraCore"
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
project "NazaraNetwork"
|
||||||
|
|
||||||
|
links "ws2_32"
|
||||||
|
|
||||||
|
files
|
||||||
|
{
|
||||||
|
"../include/Nazara/Network/**.hpp",
|
||||||
|
"../include/Nazara/Network/**.inl",
|
||||||
|
"../src/Nazara/Network/**.hpp",
|
||||||
|
"../src/Nazara/Network/**.cpp"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os.is("windows")) then
|
||||||
|
excludes { "../src/Nazara/Network/Posix/*.hpp", "../src/Nazara/Network/Posix/*.cpp" }
|
||||||
|
else
|
||||||
|
excludes { "../src/Nazara/Network/Win32/*.hpp", "../src/Nazara/Network/Win32/*.cpp" }
|
||||||
|
end
|
||||||
|
|
||||||
|
configuration "DebugStatic"
|
||||||
|
links "NazaraCored-s"
|
||||||
|
targetname "NazaraNetworkd"
|
||||||
|
|
||||||
|
configuration "ReleaseStatic"
|
||||||
|
links "NazaraCore-s"
|
||||||
|
targetname "NazaraNetwork"
|
||||||
|
|
||||||
|
configuration "DebugDLL"
|
||||||
|
links "NazaraCored"
|
||||||
|
targetname "NazaraNetworkd"
|
||||||
|
|
||||||
|
configuration "ReleaseDLL"
|
||||||
|
links "NazaraCore"
|
||||||
|
targetname "NazaraNetwork"
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
project "NazaraRenderer"
|
||||||
|
|
||||||
|
defines "NAZARA_RENDERER_OPENGL"
|
||||||
|
links "gdi32"
|
||||||
|
links "opengl32"
|
||||||
|
links "winmm"
|
||||||
|
|
||||||
|
files
|
||||||
|
{
|
||||||
|
"../include/Nazara/Renderer/**.hpp",
|
||||||
|
"../include/Nazara/Renderer/**.inl",
|
||||||
|
"../src/Nazara/Renderer/**.hpp",
|
||||||
|
"../src/Nazara/Renderer/**.cpp"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os.is("windows")) then
|
||||||
|
excludes { "../src/Nazara/Renderer/Posix/*.hpp", "../src/Nazara/Renderer/Posix/*.cpp" }
|
||||||
|
else
|
||||||
|
excludes { "../src/Nazara/Renderer/Win32/*.hpp", "../src/Nazara/Renderer/Win32/*.cpp" }
|
||||||
|
end
|
||||||
|
|
||||||
|
configuration "DebugStatic"
|
||||||
|
links "NazaraCored-s"
|
||||||
|
links "NazaraUtilityd-s"
|
||||||
|
targetname "NazaraRendererd"
|
||||||
|
|
||||||
|
configuration "ReleaseStatic"
|
||||||
|
links "NazaraCore-s"
|
||||||
|
links "NazaraUtility-s"
|
||||||
|
targetname "NazaraRenderer"
|
||||||
|
|
||||||
|
configuration "DebugDLL"
|
||||||
|
links "NazaraCored"
|
||||||
|
links "NazaraUtilityd"
|
||||||
|
targetname "NazaraRendererd"
|
||||||
|
|
||||||
|
configuration "ReleaseDLL"
|
||||||
|
links "NazaraCore"
|
||||||
|
links "NazaraUtility"
|
||||||
|
targetname "NazaraRenderer"
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
project "NazaraUtility"
|
||||||
|
|
||||||
|
files
|
||||||
|
{
|
||||||
|
"../include/Nazara/Utility/**.hpp",
|
||||||
|
"../include/Nazara/Utility/**.inl",
|
||||||
|
"../src/Nazara/Utility/**.hpp",
|
||||||
|
"../src/Nazara/Utility/**.cpp"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os.is("windows")) then
|
||||||
|
excludes { "../src/Nazara/Utility/Posix/*.hpp", "../src/Nazara/Utility/Posix/*.cpp" }
|
||||||
|
else
|
||||||
|
excludes { "../src/Nazara/Utility/Win32/*.hpp", "../src/Nazara/Utility/Win32/*.cpp" }
|
||||||
|
end
|
||||||
|
|
||||||
|
configuration "DebugStatic"
|
||||||
|
links "NazaraCored-s"
|
||||||
|
targetname "NazaraUtilityd"
|
||||||
|
|
||||||
|
configuration "ReleaseStatic"
|
||||||
|
links "NazaraCore-s"
|
||||||
|
targetname "NazaraUtility"
|
||||||
|
|
||||||
|
configuration "DebugDLL"
|
||||||
|
links "NazaraCored"
|
||||||
|
targetname "NazaraUtilityd"
|
||||||
|
|
||||||
|
configuration "ReleaseDLL"
|
||||||
|
links "NazaraCore"
|
||||||
|
targetname "NazaraUtility"
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,943 @@
|
||||||
|
#ifndef __wglext_h_
|
||||||
|
#define __wglext_h_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Copyright (c) 2007-2012 The Khronos Group Inc.
|
||||||
|
**
|
||||||
|
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
** copy of this software and/or associated documentation files (the
|
||||||
|
** "Materials"), to deal in the Materials without restriction, including
|
||||||
|
** without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||||
|
** permit persons to whom the Materials are furnished to do so, subject to
|
||||||
|
** the following conditions:
|
||||||
|
**
|
||||||
|
** The above copyright notice and this permission notice shall be included
|
||||||
|
** in all copies or substantial portions of the Materials.
|
||||||
|
**
|
||||||
|
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Function declaration macros - to move into glplatform.h */
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||||
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef APIENTRY
|
||||||
|
#define APIENTRY
|
||||||
|
#endif
|
||||||
|
#ifndef APIENTRYP
|
||||||
|
#define APIENTRYP APIENTRY *
|
||||||
|
#endif
|
||||||
|
#ifndef GLAPI
|
||||||
|
#define GLAPI extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*************************************************************/
|
||||||
|
|
||||||
|
/* Header file version number */
|
||||||
|
/* wglext.h last updated 2012/01/04 */
|
||||||
|
/* Current version at http://www.opengl.org/registry/ */
|
||||||
|
#define WGL_WGLEXT_VERSION 24
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_buffer_region
|
||||||
|
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||||
|
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||||
|
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||||
|
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_multisample
|
||||||
|
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||||
|
#define WGL_SAMPLES_ARB 0x2042
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_extensions_string
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_pixel_format
|
||||||
|
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||||
|
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||||
|
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||||
|
#define WGL_ACCELERATION_ARB 0x2003
|
||||||
|
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||||
|
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||||
|
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||||
|
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||||
|
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||||
|
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||||
|
#define WGL_TRANSPARENT_ARB 0x200A
|
||||||
|
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||||
|
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||||
|
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||||
|
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||||
|
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||||
|
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||||
|
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||||
|
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||||
|
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||||
|
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||||
|
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||||
|
#define WGL_STEREO_ARB 0x2012
|
||||||
|
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||||
|
#define WGL_COLOR_BITS_ARB 0x2014
|
||||||
|
#define WGL_RED_BITS_ARB 0x2015
|
||||||
|
#define WGL_RED_SHIFT_ARB 0x2016
|
||||||
|
#define WGL_GREEN_BITS_ARB 0x2017
|
||||||
|
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||||
|
#define WGL_BLUE_BITS_ARB 0x2019
|
||||||
|
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||||
|
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||||
|
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||||
|
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||||
|
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||||
|
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||||
|
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||||
|
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||||
|
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||||
|
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||||
|
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||||
|
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||||
|
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||||
|
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||||
|
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||||
|
#define WGL_SWAP_COPY_ARB 0x2029
|
||||||
|
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||||
|
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||||
|
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_make_current_read
|
||||||
|
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||||
|
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_pbuffer
|
||||||
|
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||||
|
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||||
|
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||||
|
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||||
|
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||||
|
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||||
|
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||||
|
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_render_texture
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||||
|
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||||
|
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||||
|
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||||
|
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||||
|
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||||
|
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||||
|
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||||
|
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||||
|
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||||
|
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||||
|
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||||
|
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||||
|
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||||
|
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||||
|
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||||
|
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||||
|
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||||
|
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||||
|
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||||
|
#define WGL_BACK_LEFT_ARB 0x2085
|
||||||
|
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||||
|
#define WGL_AUX0_ARB 0x2087
|
||||||
|
#define WGL_AUX1_ARB 0x2088
|
||||||
|
#define WGL_AUX2_ARB 0x2089
|
||||||
|
#define WGL_AUX3_ARB 0x208A
|
||||||
|
#define WGL_AUX4_ARB 0x208B
|
||||||
|
#define WGL_AUX5_ARB 0x208C
|
||||||
|
#define WGL_AUX6_ARB 0x208D
|
||||||
|
#define WGL_AUX7_ARB 0x208E
|
||||||
|
#define WGL_AUX8_ARB 0x208F
|
||||||
|
#define WGL_AUX9_ARB 0x2090
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_pixel_format_float
|
||||||
|
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_framebuffer_sRGB
|
||||||
|
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_create_context
|
||||||
|
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||||
|
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||||
|
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||||
|
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||||
|
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
|
||||||
|
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
||||||
|
#define ERROR_INVALID_VERSION_ARB 0x2095
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_create_context_profile
|
||||||
|
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||||
|
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||||
|
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||||
|
#define ERROR_INVALID_PROFILE_ARB 0x2096
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_create_context_robustness
|
||||||
|
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||||
|
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||||
|
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||||
|
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_make_current_read
|
||||||
|
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_pixel_format
|
||||||
|
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||||
|
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||||
|
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||||
|
#define WGL_ACCELERATION_EXT 0x2003
|
||||||
|
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||||
|
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||||
|
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||||
|
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||||
|
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||||
|
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||||
|
#define WGL_TRANSPARENT_EXT 0x200A
|
||||||
|
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||||
|
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||||
|
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||||
|
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||||
|
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||||
|
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||||
|
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||||
|
#define WGL_STEREO_EXT 0x2012
|
||||||
|
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||||
|
#define WGL_COLOR_BITS_EXT 0x2014
|
||||||
|
#define WGL_RED_BITS_EXT 0x2015
|
||||||
|
#define WGL_RED_SHIFT_EXT 0x2016
|
||||||
|
#define WGL_GREEN_BITS_EXT 0x2017
|
||||||
|
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||||
|
#define WGL_BLUE_BITS_EXT 0x2019
|
||||||
|
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||||
|
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||||
|
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||||
|
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||||
|
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||||
|
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||||
|
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||||
|
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||||
|
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||||
|
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||||
|
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||||
|
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||||
|
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||||
|
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||||
|
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||||
|
#define WGL_SWAP_COPY_EXT 0x2029
|
||||||
|
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||||
|
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||||
|
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_pbuffer
|
||||||
|
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||||
|
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||||
|
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||||
|
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||||
|
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||||
|
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||||
|
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||||
|
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||||
|
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_depth_float
|
||||||
|
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_3DFX_multisample
|
||||||
|
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||||
|
#define WGL_SAMPLES_3DFX 0x2061
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_multisample
|
||||||
|
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||||
|
#define WGL_SAMPLES_EXT 0x2042
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_digital_video_control
|
||||||
|
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||||
|
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||||
|
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||||
|
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_gamma
|
||||||
|
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||||
|
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_genlock
|
||||||
|
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||||
|
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
|
||||||
|
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
|
||||||
|
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
|
||||||
|
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||||
|
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||||
|
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||||
|
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||||
|
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_image_buffer
|
||||||
|
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||||
|
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_swap_frame_lock
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_render_depth_texture
|
||||||
|
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||||
|
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||||
|
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||||
|
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_render_texture_rectangle
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||||
|
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ATI_pixel_format_float
|
||||||
|
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_float_buffer
|
||||||
|
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||||
|
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||||
|
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||||
|
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||||
|
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||||
|
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_3DL_stereo_control
|
||||||
|
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
|
||||||
|
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||||
|
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||||
|
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_pixel_format_packed_float
|
||||||
|
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_framebuffer_sRGB
|
||||||
|
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_present_video
|
||||||
|
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_video_out
|
||||||
|
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
|
||||||
|
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
|
||||||
|
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
|
||||||
|
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
|
||||||
|
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||||
|
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||||
|
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||||
|
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||||
|
#define WGL_VIDEO_OUT_FRAME 0x20C8
|
||||||
|
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
|
||||||
|
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
|
||||||
|
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
|
||||||
|
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_swap_group
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_gpu_affinity
|
||||||
|
#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
|
||||||
|
#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_AMD_gpu_association
|
||||||
|
#define WGL_GPU_VENDOR_AMD 0x1F00
|
||||||
|
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
|
||||||
|
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||||
|
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||||
|
#define WGL_GPU_RAM_AMD 0x21A3
|
||||||
|
#define WGL_GPU_CLOCK_AMD 0x21A4
|
||||||
|
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
|
||||||
|
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
|
||||||
|
#define WGL_GPU_NUM_RB_AMD 0x21A7
|
||||||
|
#define WGL_GPU_NUM_SPI_AMD 0x21A8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_video_capture
|
||||||
|
#define WGL_UNIQUE_ID_NV 0x20CE
|
||||||
|
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_copy_image
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_multisample_coverage
|
||||||
|
#define WGL_COVERAGE_SAMPLES_NV 0x2042
|
||||||
|
#define WGL_COLOR_SAMPLES_NV 0x20B9
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_create_context_es2_profile
|
||||||
|
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_DX_interop
|
||||||
|
#define WGL_ACCESS_READ_ONLY_NV 0x00000000
|
||||||
|
#define WGL_ACCESS_READ_WRITE_NV 0x00000001
|
||||||
|
#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_DX_interop2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_swap_control_tear
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************/
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_pbuffer
|
||||||
|
DECLARE_HANDLE(HPBUFFERARB);
|
||||||
|
#endif
|
||||||
|
#ifndef WGL_EXT_pbuffer
|
||||||
|
DECLARE_HANDLE(HPBUFFEREXT);
|
||||||
|
#endif
|
||||||
|
#ifndef WGL_NV_present_video
|
||||||
|
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
|
||||||
|
#endif
|
||||||
|
#ifndef WGL_NV_video_output
|
||||||
|
DECLARE_HANDLE(HPVIDEODEV);
|
||||||
|
#endif
|
||||||
|
#ifndef WGL_NV_gpu_affinity
|
||||||
|
DECLARE_HANDLE(HPGPUNV);
|
||||||
|
DECLARE_HANDLE(HGPUNV);
|
||||||
|
|
||||||
|
typedef struct _GPU_DEVICE {
|
||||||
|
DWORD cb;
|
||||||
|
CHAR DeviceName[32];
|
||||||
|
CHAR DeviceString[128];
|
||||||
|
DWORD Flags;
|
||||||
|
RECT rcVirtualScreen;
|
||||||
|
} GPU_DEVICE, *PGPU_DEVICE;
|
||||||
|
#endif
|
||||||
|
#ifndef WGL_NV_video_capture
|
||||||
|
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_buffer_region
|
||||||
|
#define WGL_ARB_buffer_region 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
|
||||||
|
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
|
||||||
|
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
|
||||||
|
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||||
|
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_multisample
|
||||||
|
#define WGL_ARB_multisample 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_extensions_string
|
||||||
|
#define WGL_ARB_extensions_string 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_pixel_format
|
||||||
|
#define WGL_ARB_pixel_format 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||||
|
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||||
|
extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_make_current_read
|
||||||
|
#define WGL_ARB_make_current_read 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||||
|
extern HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||||
|
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_pbuffer
|
||||||
|
#define WGL_ARB_pbuffer 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||||
|
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
|
||||||
|
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
|
||||||
|
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
|
||||||
|
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||||
|
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||||
|
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_render_texture
|
||||||
|
#define WGL_ARB_render_texture 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||||
|
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||||
|
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_pixel_format_float
|
||||||
|
#define WGL_ARB_pixel_format_float 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_framebuffer_sRGB
|
||||||
|
#define WGL_ARB_framebuffer_sRGB 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_create_context
|
||||||
|
#define WGL_ARB_create_context 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_create_context_profile
|
||||||
|
#define WGL_ARB_create_context_profile 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ARB_create_context_robustness
|
||||||
|
#define WGL_ARB_create_context_robustness 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_display_color_table
|
||||||
|
#define WGL_EXT_display_color_table 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
|
||||||
|
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
|
||||||
|
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
|
||||||
|
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||||
|
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||||
|
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||||
|
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_extensions_string
|
||||||
|
#define WGL_EXT_extensions_string 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern const char * WINAPI wglGetExtensionsStringEXT (void);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_make_current_read
|
||||||
|
#define WGL_EXT_make_current_read 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||||
|
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||||
|
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_pbuffer
|
||||||
|
#define WGL_EXT_pbuffer 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||||
|
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
|
||||||
|
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||||
|
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
|
||||||
|
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||||
|
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||||
|
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_pixel_format
|
||||||
|
#define WGL_EXT_pixel_format 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||||
|
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||||
|
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_swap_control
|
||||||
|
#define WGL_EXT_swap_control 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglSwapIntervalEXT (int interval);
|
||||||
|
extern int WINAPI wglGetSwapIntervalEXT (void);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||||
|
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_depth_float
|
||||||
|
#define WGL_EXT_depth_float 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_vertex_array_range
|
||||||
|
#define WGL_NV_vertex_array_range 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||||
|
extern void WINAPI wglFreeMemoryNV (void *pointer);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||||
|
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_3DFX_multisample
|
||||||
|
#define WGL_3DFX_multisample 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_multisample
|
||||||
|
#define WGL_EXT_multisample 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_OML_sync_control
|
||||||
|
#define WGL_OML_sync_control 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||||
|
extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||||
|
extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||||
|
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||||
|
extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||||
|
extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||||
|
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||||
|
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_digital_video_control
|
||||||
|
#define WGL_I3D_digital_video_control 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||||
|
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_gamma
|
||||||
|
#define WGL_I3D_gamma 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||||
|
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||||
|
extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||||
|
extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_genlock
|
||||||
|
#define WGL_I3D_genlock 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
|
||||||
|
extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
|
||||||
|
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
|
||||||
|
extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
|
||||||
|
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
|
||||||
|
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
|
||||||
|
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
|
||||||
|
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
|
||||||
|
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
|
||||||
|
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
|
||||||
|
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
|
||||||
|
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_image_buffer
|
||||||
|
#define WGL_I3D_image_buffer 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||||
|
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
|
||||||
|
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||||
|
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_swap_frame_lock
|
||||||
|
#define WGL_I3D_swap_frame_lock 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||||
|
extern BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||||
|
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
|
||||||
|
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_I3D_swap_frame_usage
|
||||||
|
#define WGL_I3D_swap_frame_usage 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
|
||||||
|
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||||
|
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||||
|
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_ATI_pixel_format_float
|
||||||
|
#define WGL_ATI_pixel_format_float 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_float_buffer
|
||||||
|
#define WGL_NV_float_buffer 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_3DL_stereo_control
|
||||||
|
#define WGL_3DL_stereo_control 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_pixel_format_packed_float
|
||||||
|
#define WGL_EXT_pixel_format_packed_float 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_framebuffer_sRGB
|
||||||
|
#define WGL_EXT_framebuffer_sRGB 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_present_video
|
||||||
|
#define WGL_NV_present_video 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||||
|
extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||||
|
extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_video_output
|
||||||
|
#define WGL_NV_video_output 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||||
|
extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
|
||||||
|
extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||||
|
extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||||
|
extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||||
|
extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_swap_group
|
||||||
|
#define WGL_NV_swap_group 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
|
||||||
|
extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
|
||||||
|
extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
|
||||||
|
extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||||
|
extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
|
||||||
|
extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_gpu_affinity
|
||||||
|
#define WGL_NV_gpu_affinity 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
|
||||||
|
extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||||
|
extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
|
||||||
|
extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||||
|
extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||||
|
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_AMD_gpu_association
|
||||||
|
#define WGL_AMD_gpu_association 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
|
||||||
|
extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||||
|
extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
|
||||||
|
extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
|
||||||
|
extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
|
||||||
|
extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
|
||||||
|
extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
|
||||||
|
extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
|
||||||
|
extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
|
||||||
|
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||||
|
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||||
|
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
|
||||||
|
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||||
|
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||||
|
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_video_capture
|
||||||
|
#define WGL_NV_video_capture 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||||
|
extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||||
|
extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||||
|
extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||||
|
extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||||
|
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_copy_image
|
||||||
|
#define WGL_NV_copy_image 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_multisample_coverage
|
||||||
|
#define WGL_NV_multisample_coverage 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_DX_interop
|
||||||
|
#define WGL_NV_DX_interop 1
|
||||||
|
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||||
|
extern BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
|
||||||
|
extern HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
|
||||||
|
extern BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
|
||||||
|
extern HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||||
|
extern BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
|
||||||
|
extern BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
|
||||||
|
extern BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||||
|
extern BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||||
|
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
|
||||||
|
typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
|
||||||
|
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||||
|
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_NV_DX_interop2
|
||||||
|
#define WGL_NV_DX_interop2 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WGL_EXT_swap_control_tear
|
||||||
|
#define WGL_EXT_swap_control_tear 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
Nazara Engine
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CONFIG_AUDIO_HPP
|
||||||
|
#define NAZARA_CONFIG_AUDIO_HPP
|
||||||
|
|
||||||
|
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||||
|
|
||||||
|
// Utilise un tracker pour repérer les éventuels leaks (Ralentit l'exécution)
|
||||||
|
#define NAZARA_AUDIO_MEMORYLEAKTRACKER 0
|
||||||
|
|
||||||
|
#endif // NAZARA_CONFIG_AUDIOs_HPP
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Audio/Config.hpp>
|
||||||
|
#if NAZARA_AUDIO_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||||
|
#define new new(__FILE__, __LINE__)
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#if NAZARA_AUDIO_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#undef delete
|
||||||
|
#undef new
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_SOUND_HPP
|
||||||
|
#define NAZARA_SOUND_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <Nazara/Utility/Resource.hpp>
|
||||||
|
|
||||||
|
class NAZARA_API NzSound
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzSound();
|
||||||
|
~NzSound();
|
||||||
|
|
||||||
|
bool LoadFromFile(const NzString& filePath);
|
||||||
|
bool LoadFromMemory(const nzUInt8* ptr, std::size_t size);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // NAZARA_SOUND_HPP
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_BYTEARRAY_HPP
|
||||||
|
#define NAZARA_BYTEARRAY_HPP
|
||||||
|
|
||||||
|
#define NAZARA_BYTEARRAY
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/Hashable.hpp>
|
||||||
|
#include <Nazara/Core/ThreadSafety.hpp>
|
||||||
|
|
||||||
|
class NzAbstractHash;
|
||||||
|
class NzHashDigest;
|
||||||
|
|
||||||
|
class NAZARA_API NzByteArray : public NzHashable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct SharedArray;
|
||||||
|
|
||||||
|
NzByteArray();
|
||||||
|
NzByteArray(const nzUInt8* buffer, unsigned int bufferLength);
|
||||||
|
NzByteArray(const NzByteArray& buffer);
|
||||||
|
NzByteArray(NzByteArray&& buffer);
|
||||||
|
NzByteArray(SharedArray* sharedArray);
|
||||||
|
~NzByteArray();
|
||||||
|
|
||||||
|
unsigned int Capacity() const;
|
||||||
|
|
||||||
|
void Clear();
|
||||||
|
|
||||||
|
const nzUInt8* GetBuffer() const;
|
||||||
|
unsigned int GetSize() const;
|
||||||
|
|
||||||
|
NzByteArray& Insert(int pos, const nzUInt8* buffer, unsigned int bufferLength);
|
||||||
|
NzByteArray& Insert(int pos, const NzByteArray& byteArray);
|
||||||
|
|
||||||
|
bool IsEmpty() const;
|
||||||
|
|
||||||
|
void Reserve(unsigned int bufferSize);
|
||||||
|
|
||||||
|
NzByteArray& Resize(int size, nzUInt8 byte = '\0');
|
||||||
|
NzByteArray Resized(int size, nzUInt8 byte = '\0') const;
|
||||||
|
|
||||||
|
NzByteArray SubArray(int startPos, int endPos = -1) const;
|
||||||
|
|
||||||
|
void Swap(NzByteArray& byteArray);
|
||||||
|
|
||||||
|
NzByteArray& Trim(nzUInt8 byte = '\0');
|
||||||
|
NzByteArray Trimmed(nzUInt8 byte = '\0') const;
|
||||||
|
|
||||||
|
// Méthodes compatibles STD
|
||||||
|
nzUInt8* begin();
|
||||||
|
const nzUInt8* begin() const;
|
||||||
|
nzUInt8* end();
|
||||||
|
const nzUInt8* end() const;
|
||||||
|
void push_front(nzUInt8 c);
|
||||||
|
void push_back(nzUInt8 c);
|
||||||
|
/*nzUInt8* rbegin();
|
||||||
|
const nzUInt8* rbegin() const;
|
||||||
|
nzUInt8* rend();
|
||||||
|
const nzUInt8* rend() const;*/
|
||||||
|
|
||||||
|
typedef const nzUInt8& const_reference;
|
||||||
|
typedef nzUInt8* iterator;
|
||||||
|
//typedef nzUInt8* reverse_iterator;
|
||||||
|
typedef nzUInt8 value_type;
|
||||||
|
// Méthodes compatibles STD
|
||||||
|
|
||||||
|
nzUInt8& operator[](unsigned int pos);
|
||||||
|
nzUInt8 operator[](unsigned int pos) const;
|
||||||
|
|
||||||
|
NzByteArray& operator=(const NzByteArray& byteArray);
|
||||||
|
NzByteArray& operator=(NzByteArray&& byteArray);
|
||||||
|
|
||||||
|
NzByteArray operator+(const NzByteArray& byteArray) const;
|
||||||
|
NzByteArray& operator+=(const NzByteArray& byteArray);
|
||||||
|
|
||||||
|
static int Compare(const NzByteArray& first, const NzByteArray& second);
|
||||||
|
|
||||||
|
struct NAZARA_API SharedArray
|
||||||
|
{
|
||||||
|
SharedArray() :
|
||||||
|
refCount(1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
SharedArray(unsigned int bufferSize, unsigned int arraySize, unsigned short referenceCount, nzUInt8* ptr) :
|
||||||
|
allocatedSize(bufferSize),
|
||||||
|
size(arraySize),
|
||||||
|
refCount(referenceCount),
|
||||||
|
buffer(ptr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int allocatedSize;
|
||||||
|
unsigned int size;
|
||||||
|
unsigned short refCount;
|
||||||
|
nzUInt8* buffer;
|
||||||
|
|
||||||
|
NazaraMutex(mutex)
|
||||||
|
};
|
||||||
|
|
||||||
|
static SharedArray emptyArray;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void EnsureOwnership();
|
||||||
|
bool FillHash(NzHashImpl* hash) const;
|
||||||
|
void ReleaseArray();
|
||||||
|
|
||||||
|
SharedArray* m_sharedArray;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
NAZARA_API void swap(NzByteArray& lhs, NzByteArray& rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef NAZARA_BYTEARRAY
|
||||||
|
|
||||||
|
#endif // NAZARA_BYTEARRAY_HPP
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CLOCK_HPP
|
||||||
|
#define NAZARA_CLOCK_HPP
|
||||||
|
|
||||||
|
#define NAZARA_CLOCK
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/ThreadSafety.hpp>
|
||||||
|
|
||||||
|
class NAZARA_API NzClock
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzClock();
|
||||||
|
|
||||||
|
float GetSeconds() const;
|
||||||
|
nzUInt64 GetMicroseconds() const;
|
||||||
|
nzUInt64 GetMilliseconds() const;
|
||||||
|
|
||||||
|
bool IsPaused() const;
|
||||||
|
|
||||||
|
void Pause();
|
||||||
|
void Restart();
|
||||||
|
void Unpause();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NazaraMutexAttrib(m_mutex, mutable)
|
||||||
|
|
||||||
|
nzUInt64 m_elapsedTime;
|
||||||
|
nzUInt64 m_refTime;
|
||||||
|
bool m_paused;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef nzUInt64 (*NzClockFunction)();
|
||||||
|
|
||||||
|
extern NAZARA_API NzClockFunction NzGetMicroseconds;
|
||||||
|
extern NAZARA_API NzClockFunction NzGetMilliseconds;
|
||||||
|
|
||||||
|
#undef NAZARA_CLOCK
|
||||||
|
|
||||||
|
#endif // NAZARA_CLOCK_HPP
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
/*
|
||||||
|
Nazara Engine
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CONFIG_CORE_HPP
|
||||||
|
#define NAZARA_CONFIG_CORE_HPP
|
||||||
|
|
||||||
|
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||||
|
|
||||||
|
// Appelle exit dès qu'une assertion est invalide
|
||||||
|
#define NAZARA_CORE_EXIT_ON_ASSERT_FAILURE 1
|
||||||
|
|
||||||
|
// Teste les assertions
|
||||||
|
#define NAZARA_CORE_ENABLE_ASSERTS 0
|
||||||
|
|
||||||
|
// Taille du buffer lors d'une lecture complète d'un fichier (ex: Hash)
|
||||||
|
#define NAZARA_CORE_FILE_BUFFERSIZE 4096
|
||||||
|
|
||||||
|
// Le moteur doit-il incorporer les Unicode Character Data (Nécessaires pour faire fonctionner le flag NzString::HandleUTF8)
|
||||||
|
#define NAZARA_CORE_INCLUDE_UNICODEDATA 0
|
||||||
|
|
||||||
|
// Utilise un tracker pour repérer les éventuels leaks (Ralentit l'exécution)
|
||||||
|
#define NAZARA_CORE_MEMORYLEAKTRACKER 0
|
||||||
|
|
||||||
|
// Standardise les séparateurs des dossiers selon le système d'exploitation courant
|
||||||
|
#define NAZARA_CORE_NORMALIZE_DIRECTORY_SEPARATORS 1
|
||||||
|
|
||||||
|
// Précision des réels lors de la transformation en texte (Max. chiffres après la virgule)
|
||||||
|
#define NAZARA_CORE_REAL_PRECISION 6
|
||||||
|
|
||||||
|
// Redirige la sortie du log sur le flux d'erreur standard (cerr) en cas d'erreur d'écriture (ou d'ouverture du fichier)
|
||||||
|
#define NAZARA_CORE_REDIRECT_TO_CERR_ON_LOG_FAILURE 1
|
||||||
|
|
||||||
|
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||||
|
#define NAZARA_CORE_SAFE 1
|
||||||
|
|
||||||
|
// Protége le noyau des accès concurrentiels
|
||||||
|
#define NAZARA_CORE_THREADSAFE 1
|
||||||
|
|
||||||
|
#if NAZARA_CORE_THREADSAFE
|
||||||
|
#define NAZARA_THREADSAFETY_APPLICATION 1 // NzApplication
|
||||||
|
#define NAZARA_THREADSAFETY_CLOCK 0 // NzClock
|
||||||
|
#define NAZARA_THREADSAFETY_DIRECTORY 1 // NzDirectory
|
||||||
|
#define NAZARA_THREADSAFETY_DYNLIB 1 // NzDynLib
|
||||||
|
#define NAZARA_THREADSAFETY_FILE 1 // NzFile
|
||||||
|
#define NAZARA_THREADSAFETY_HASHDIGEST 0 // NzHashDigest
|
||||||
|
#define NAZARA_THREADSAFETY_LOG 1 // NzLog
|
||||||
|
#define NAZARA_THREADSAFETY_STRING 1 // NzString
|
||||||
|
#define NAZARA_THREADSAFETY_STRINGSTREAM 0 // NzStringStream
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Règle le temps entre le réveil du thread des timers et l'activation d'un timer (En millisecondes)
|
||||||
|
#define NAZARA_CORE_TIMER_WAKEUPTIME 10
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // NAZARA_CONFIG_CORE_HPP
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Config.hpp>
|
||||||
|
#if NAZARA_CORE_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||||
|
#define new new(__FILE__, __LINE__)
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_DEBUG_MEMORYLEAKTRACKER_HPP
|
||||||
|
#define NAZARA_DEBUG_MEMORYLEAKTRACKER_HPP
|
||||||
|
|
||||||
|
#define NAZARA_DEBUG_MEMORYLEAKTRACKER
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
class NAZARA_API NzMemoryManager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzMemoryManager();
|
||||||
|
~NzMemoryManager();
|
||||||
|
|
||||||
|
static void* Allocate(std::size_t size, bool multi, const char* file = nullptr, unsigned int line = 0);
|
||||||
|
static void Free(void* pointer, bool multi);
|
||||||
|
static void NextFree(const char* file, unsigned int line);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static void EnsureInitialization();
|
||||||
|
static void Initialize();
|
||||||
|
static char* TimeInfo();
|
||||||
|
static void Uninitialize();
|
||||||
|
};
|
||||||
|
|
||||||
|
NAZARA_API void* operator new(std::size_t size, const char* file, unsigned int line);
|
||||||
|
NAZARA_API void* operator new[](std::size_t size, const char* file, unsigned int line);
|
||||||
|
NAZARA_API void operator delete(void* ptr, const char* file, unsigned int line) throw();
|
||||||
|
NAZARA_API void operator delete[](void* ptr, const char* file, unsigned int line) throw();
|
||||||
|
|
||||||
|
#undef NAZARA_DEBUG_MEMORYLEAKTRACKER
|
||||||
|
|
||||||
|
#endif // NAZARA_DEBUG_MEMORYLEAKTRACKER_HPP
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#if NAZARA_CORE_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#undef delete
|
||||||
|
#undef new
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_DIRECTORY_HPP
|
||||||
|
#define NAZARA_DIRECTORY_HPP
|
||||||
|
|
||||||
|
#define NAZARA_DIRECTORY
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <Nazara/Core/ThreadSafety.hpp>
|
||||||
|
|
||||||
|
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||||
|
#define NAZARA_DIRECTORY_SEPARATOR '\\'
|
||||||
|
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||||
|
#define NAZARA_DIRECTORY_SEPARATOR '/'
|
||||||
|
#else
|
||||||
|
#error OS not handled
|
||||||
|
#define NAZARA_DIRECTORY_SEPARATOR '/'
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class NzDirectoryImpl;
|
||||||
|
|
||||||
|
class NAZARA_API NzDirectory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzDirectory();
|
||||||
|
NzDirectory(const NzString& dirPath);
|
||||||
|
~NzDirectory();
|
||||||
|
|
||||||
|
void Close();
|
||||||
|
|
||||||
|
NzString GetResultName() const;
|
||||||
|
NzString GetResultPath() const;
|
||||||
|
nzUInt64 GetResultSize() const;
|
||||||
|
|
||||||
|
bool IsResultDirectory() const;
|
||||||
|
|
||||||
|
bool NextResult(bool skipDots = true);
|
||||||
|
|
||||||
|
bool Open();
|
||||||
|
|
||||||
|
void SetDirectory(const NzString& dirPath);
|
||||||
|
|
||||||
|
static bool Copy(const NzString& sourcePath, const NzString& destPath);
|
||||||
|
static bool Create(const NzString& dirPath, bool recursive = false);
|
||||||
|
static bool Exists(const NzString& dirPath);
|
||||||
|
static NzString GetCurrent();
|
||||||
|
static bool Remove(const NzString& dirPath, bool emptyDirectory = false);
|
||||||
|
static bool SetCurrent(const NzString& dirPath);
|
||||||
|
|
||||||
|
private:
|
||||||
|
NazaraMutexAttrib(m_mutex, mutable)
|
||||||
|
|
||||||
|
NzString m_dirPath;
|
||||||
|
NzDirectoryImpl* m_impl;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_DIRECTORY
|
||||||
|
|
||||||
|
#endif // NAZARA_DIRECTORY_HPP
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_DYNLIB_HPP
|
||||||
|
#define NAZARA_DYNLIB_HPP
|
||||||
|
|
||||||
|
#define NAZARA_DYNLIB
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <Nazara/Core/ThreadSafety.hpp>
|
||||||
|
#include <Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
class NzDynLibImpl;
|
||||||
|
typedef int (*NzDynLibFunc)(); // Type "générique" de pointeur sur fonction
|
||||||
|
|
||||||
|
class NzDynLib : NzNonCopyable
|
||||||
|
{
|
||||||
|
friend class NzDynLibImpl;
|
||||||
|
|
||||||
|
public:
|
||||||
|
NzDynLib(const NzString& libraryPath);
|
||||||
|
~NzDynLib();
|
||||||
|
|
||||||
|
NzString GetLastError() const;
|
||||||
|
NzDynLibFunc GetSymbol(const NzString& symbol) const;
|
||||||
|
bool Load();
|
||||||
|
void Unload();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void SetLastError(const NzString& error);
|
||||||
|
|
||||||
|
NazaraMutexAttrib(m_mutex, mutable)
|
||||||
|
|
||||||
|
NzString m_lastError;
|
||||||
|
NzString m_path;
|
||||||
|
NzDynLibImpl* m_impl;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_DYNLIB
|
||||||
|
|
||||||
|
#endif // NAZARA_DYNLIB_HPP
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_ENDIANNESS_HPP
|
||||||
|
#define NAZARA_ENDIANNESS_HPP
|
||||||
|
|
||||||
|
#define NAZARA_ENDIANNESS
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
#if defined(NAZARA_ENDIANNESS_BIGENDIAN)
|
||||||
|
#define NAZARA_ENDIANNESS_DETECTED 1
|
||||||
|
#define NazaraEndianness nzEndianness_BigEndian
|
||||||
|
#elif defined(NAZARA_ENDIANNESS_LITTLEENDIAN)
|
||||||
|
#define NAZARA_ENDIANNESS_DETECTED 1
|
||||||
|
#define NazaraEndianness nzEndianness_LittleEndian
|
||||||
|
#else
|
||||||
|
#if defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || (defined(__MIPS__) && defined(__MISPEB__)) || \
|
||||||
|
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || defined(__sparc__) || defined(__hppa__)
|
||||||
|
#define NAZARA_ENDIANNESS_DETECTED 1
|
||||||
|
#define NAZARA_ENDIANNESS_BIGENDIAN
|
||||||
|
#define NazaraEndianness nzEndianness_BigEndian
|
||||||
|
#elif defined(__i386__) || defined(__i386) || defined(__X86__) || defined (__x86_64)
|
||||||
|
#define NAZARA_ENDIANNESS_DETECTED 1
|
||||||
|
#define NAZARA_ENDIANNESS_LITTLEENDIAN
|
||||||
|
#define NazaraEndianness nzEndianness_LittleEndian
|
||||||
|
#else
|
||||||
|
#define NAZARA_ENDIANNESS_DETECTED 0
|
||||||
|
#define NazaraEndianness NzGetPlatformEndianness()
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
enum nzEndianness
|
||||||
|
{
|
||||||
|
nzEndianness_BigEndian,
|
||||||
|
nzEndianness_LittleEndian,
|
||||||
|
nzEndianness_Unknown
|
||||||
|
};
|
||||||
|
|
||||||
|
inline void NzByteSwap(void* buffer, unsigned int size);
|
||||||
|
inline nzEndianness NzGetPlatformEndianness();
|
||||||
|
|
||||||
|
#include <Nazara/Core/Endianness.inl>
|
||||||
|
|
||||||
|
#undef NAZARA_ENDIANNESS
|
||||||
|
|
||||||
|
#endif // NAZARA_ENDIANNESS_HPP
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
inline void NzByteSwap(void* buffer, unsigned int size)
|
||||||
|
{
|
||||||
|
nzUInt8* bytes = reinterpret_cast<nzUInt8*>(buffer);
|
||||||
|
unsigned int i = 0;
|
||||||
|
unsigned int j = size-1;
|
||||||
|
|
||||||
|
while (i < j)
|
||||||
|
std::swap(bytes[i++], bytes[j--]);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline nzEndianness NzGetPlatformEndianness()
|
||||||
|
{
|
||||||
|
#if NAZARA_ENDIANNESS_DETECTED
|
||||||
|
return NazaraEndianness;
|
||||||
|
#else
|
||||||
|
static nzEndianness endianness = nzEndianness_Unknown;
|
||||||
|
static bool tested = false;
|
||||||
|
if (!tested)
|
||||||
|
{
|
||||||
|
nzUInt32 i = 1;
|
||||||
|
nzUInt8* p = reinterpret_cast<nzUInt8*>(&i);
|
||||||
|
|
||||||
|
// Méthode de récupération de l'endianness au runtime
|
||||||
|
if (p[0] == 1)
|
||||||
|
endianness = nzEndianness_LittleEndian;
|
||||||
|
else if (p[3] == 1)
|
||||||
|
endianness = nzEndianness_BigEndian;
|
||||||
|
|
||||||
|
tested = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return endianness;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_ERROR_HPP
|
||||||
|
#define NAZARA_ERROR_HPP
|
||||||
|
|
||||||
|
#define NAZARA_ERROR
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
#if NAZARA_CORE_ENABLE_ASSERTS || defined(NAZARA_DEBUG)
|
||||||
|
#define NazaraAssert(a, err) if (!(a)) NzError(nzErrorType_AssertFailed, err, __LINE__, __FILE__, NAZARA_FUNCTION)
|
||||||
|
#else
|
||||||
|
#define NazaraAssert(a, err)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NazaraError(err) NzError(nzErrorType_Normal, err, __LINE__, __FILE__, NAZARA_FUNCTION)
|
||||||
|
#define NazaraInternalError(err) NzError(nzErrorType_Internal, err, __LINE__, __FILE__, NAZARA_FUNCTION)
|
||||||
|
#define NazaraWarning(err) NzError(nzErrorType_Warning, err, __LINE__, __FILE__, NAZARA_FUNCTION)
|
||||||
|
|
||||||
|
enum nzErrorType
|
||||||
|
{
|
||||||
|
nzErrorType_AssertFailed,
|
||||||
|
nzErrorType_Internal,
|
||||||
|
nzErrorType_Normal,
|
||||||
|
nzErrorType_Warning
|
||||||
|
};
|
||||||
|
|
||||||
|
NAZARA_API void NzError(nzErrorType type, const NzString& error, unsigned int line, const char* file, const char* function);
|
||||||
|
NAZARA_API unsigned int NzGetLastSystemErrorCode();
|
||||||
|
NAZARA_API NzString NzGetLastSystemError(unsigned int code = NzGetLastSystemErrorCode());
|
||||||
|
|
||||||
|
#undef NAZARA_ERROR
|
||||||
|
|
||||||
|
#endif // NAZARA_ERROR_HPP
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_FILE_HPP
|
||||||
|
#define NAZARA_FILE_HPP
|
||||||
|
|
||||||
|
#define NAZARA_FILE
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/Directory.hpp>
|
||||||
|
#include <Nazara/Core/Endianness.hpp>
|
||||||
|
#include <Nazara/Core/Hashable.hpp>
|
||||||
|
#include <Nazara/Core/HashDigest.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <Nazara/Core/ThreadSafety.hpp>
|
||||||
|
#include <Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
class NzFileImpl;
|
||||||
|
|
||||||
|
class NAZARA_API NzFile : public NzHashable, NzNonCopyable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum CursorPosition
|
||||||
|
{
|
||||||
|
AtBegin, // Début du fichier
|
||||||
|
AtCurrent, // Position du pointeur
|
||||||
|
AtEnd // Fin du fichier
|
||||||
|
};
|
||||||
|
|
||||||
|
enum OpenMode
|
||||||
|
{
|
||||||
|
Current = 0x00, // Utilise le mode d'ouverture actuel
|
||||||
|
|
||||||
|
Append = 0x01, // Empêche l'écriture sur la partie déjà existante et met le curseur à la fin
|
||||||
|
Lock = 0x02, // Empêche le fichier d'être modifié tant qu'il est ouvert
|
||||||
|
ReadOnly = 0x04, // Ouvre uniquement en lecture
|
||||||
|
ReadWrite = 0x08, // Ouvre en lecture/écriture
|
||||||
|
Text = 0x10, // Ouvre en mode texte
|
||||||
|
Truncate = 0x20, // Créé le fichier s'il n'existe pas et le vide s'il existe
|
||||||
|
WriteOnly = 0x40 // Ouvre uniquement en écriture, créé le fichier s'il n'existe pas
|
||||||
|
};
|
||||||
|
|
||||||
|
NzFile();
|
||||||
|
NzFile(const NzString& filePath);
|
||||||
|
NzFile(const NzString& filePath, unsigned long openMode);
|
||||||
|
NzFile(NzFile&& file);
|
||||||
|
~NzFile();
|
||||||
|
|
||||||
|
bool Copy(const NzString& newFilePath);
|
||||||
|
void Close();
|
||||||
|
|
||||||
|
bool Delete();
|
||||||
|
|
||||||
|
bool EndOfFile() const;
|
||||||
|
|
||||||
|
bool Exists() const;
|
||||||
|
|
||||||
|
void Flush();
|
||||||
|
|
||||||
|
time_t GetCreationTime() const;
|
||||||
|
nzUInt64 GetCursorPos() const;
|
||||||
|
NzString GetDirectoryPath() const;
|
||||||
|
NzString GetFilePath() const;
|
||||||
|
NzString GetFileName() const;
|
||||||
|
time_t GetLastAccessTime() const;
|
||||||
|
time_t GetLastWriteTime() const;
|
||||||
|
NzString GetLine(unsigned int lineSize = 0);
|
||||||
|
nzUInt64 GetSize() const;
|
||||||
|
|
||||||
|
bool IsOpen() const;
|
||||||
|
|
||||||
|
bool Open(unsigned long openMode = Current);
|
||||||
|
|
||||||
|
std::size_t Read(void* buffer, std::size_t typeSize, unsigned int count);
|
||||||
|
bool Rename(const NzString& newFilePath);
|
||||||
|
|
||||||
|
bool SetCursorPos(CursorPosition pos, nzInt64 offset = 0);
|
||||||
|
bool SetCursorPos(nzUInt64 offset);
|
||||||
|
void SetEndianness(nzEndianness endianness);
|
||||||
|
bool SetFile(const NzString& filePath);
|
||||||
|
bool SetOpenMode(unsigned int openMode);
|
||||||
|
|
||||||
|
bool Write(const NzString& string);
|
||||||
|
std::size_t Write(const void* buffer, std::size_t typeSize, unsigned int count);
|
||||||
|
|
||||||
|
NzFile& operator=(const NzString& filePath);
|
||||||
|
NzFile& operator=(NzFile&& file);
|
||||||
|
|
||||||
|
static NzString AbsolutePath(const NzString& filePath);
|
||||||
|
static bool Copy(const NzString& sourcePath, const NzString& targetPath);
|
||||||
|
static bool Delete(const NzString& filePath);
|
||||||
|
static bool Exists(const NzString& filePath);
|
||||||
|
static time_t GetCreationTime(const NzString& filePath);
|
||||||
|
static time_t GetLastAccessTime(const NzString& filePath);
|
||||||
|
static time_t GetLastWriteTime(const NzString& filePath);
|
||||||
|
static NzHashDigest GetHash(const NzString& filePath, nzHash hash);
|
||||||
|
static NzHashDigest GetHash(const NzString& filePath, NzHashImpl* hash);
|
||||||
|
static nzUInt64 GetSize(const NzString& filePath);
|
||||||
|
static bool IsAbsolute(const NzString& path);
|
||||||
|
static NzString NormalizePath(const NzString& filePath);
|
||||||
|
static NzString NormalizeSeparators(const NzString& filePath);
|
||||||
|
static bool Rename(const NzString& sourcePath, const NzString& targetPath);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool FillHash(NzHashImpl* hash) const;
|
||||||
|
|
||||||
|
NazaraMutexAttrib(m_mutex, mutable)
|
||||||
|
|
||||||
|
nzEndianness m_endianness;
|
||||||
|
NzString m_filePath;
|
||||||
|
NzFileImpl* m_impl;
|
||||||
|
unsigned int m_openMode;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_FILE
|
||||||
|
|
||||||
|
#endif // NAZARA_FILE_HPP
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_FORMAT_HPP
|
||||||
|
#define NAZARA_FORMAT_HPP
|
||||||
|
|
||||||
|
#define NAZARA_FORMAT
|
||||||
|
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
template<typename... Args> NzString NzFormat(const NzString& str, Args... args);
|
||||||
|
|
||||||
|
#undef NAZARA_FORMAT
|
||||||
|
|
||||||
|
#endif // NAZARA_FORMAT_HPP
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_HASH_HPP
|
||||||
|
#define NAZARA_HASH_HPP
|
||||||
|
|
||||||
|
#define NAZARA_HASH
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/Hashable.hpp>
|
||||||
|
#include <Nazara/Core/HashDigest.hpp>
|
||||||
|
#include <Nazara/Core/HashImpl.hpp>
|
||||||
|
#include <Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
class NAZARA_API NzHash : NzNonCopyable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzHash(nzHash hash);
|
||||||
|
NzHash(NzHashImpl* hashImpl);
|
||||||
|
~NzHash();
|
||||||
|
|
||||||
|
NzHashDigest Hash(const NzHashable& hashable);
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzHashImpl* m_impl;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_HASH
|
||||||
|
|
||||||
|
#endif // NAZARA_HASH_HPP
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_HASH_CRC32_HPP
|
||||||
|
#define NAZARA_HASH_CRC32_HPP
|
||||||
|
|
||||||
|
#define NAZARA_HASH_CRC32
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/HashDigest.hpp>
|
||||||
|
#include <Nazara/Core/HashImpl.hpp>
|
||||||
|
|
||||||
|
struct NzHashCRC32_state;
|
||||||
|
|
||||||
|
class NAZARA_API NzHashCRC32 : public NzHashImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzHashCRC32(nzUInt32 polynomial = 0x04c11db7);
|
||||||
|
virtual ~NzHashCRC32();
|
||||||
|
|
||||||
|
void Append(const nzUInt8* data, unsigned int len);
|
||||||
|
void Begin();
|
||||||
|
NzHashDigest End();
|
||||||
|
|
||||||
|
static unsigned int GetDigestLength();
|
||||||
|
static NzString GetHashName();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzHashCRC32_state* m_state;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_HASH_CRC32
|
||||||
|
|
||||||
|
#endif // NAZARA_HASH_CRC32_HPP
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_HASH_FLETCHER16_HPP
|
||||||
|
#define NAZARA_HASH_FLETCHER16_HPP
|
||||||
|
|
||||||
|
#define NAZARA_HASH_FLETCHER16
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/HashDigest.hpp>
|
||||||
|
#include <Nazara/Core/HashImpl.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
struct NzHashFletcher16_state;
|
||||||
|
|
||||||
|
class NAZARA_API NzHashFletcher16 : public NzHashImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzHashFletcher16();
|
||||||
|
virtual ~NzHashFletcher16();
|
||||||
|
|
||||||
|
void Append(const nzUInt8* data, unsigned int len);
|
||||||
|
void Begin();
|
||||||
|
NzHashDigest End();
|
||||||
|
|
||||||
|
static unsigned int GetDigestLength();
|
||||||
|
static NzString GetHashName();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzHashFletcher16_state* m_state;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_HASH_FLETCHER16
|
||||||
|
|
||||||
|
#endif // NAZARA_HASH_FLETCHER16_HPP
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_HASH_MD5_HPP
|
||||||
|
#define NAZARA_HASH_MD5_HPP
|
||||||
|
|
||||||
|
#define NAZARA_HASH_MD5
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/HashDigest.hpp>
|
||||||
|
#include <Nazara/Core/HashImpl.hpp>
|
||||||
|
|
||||||
|
struct NzHashMD5_state;
|
||||||
|
|
||||||
|
class NAZARA_API NzHashMD5 : public NzHashImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzHashMD5();
|
||||||
|
virtual ~NzHashMD5();
|
||||||
|
|
||||||
|
void Append(const nzUInt8* data, unsigned int len);
|
||||||
|
void Begin();
|
||||||
|
NzHashDigest End();
|
||||||
|
|
||||||
|
static unsigned int GetDigestLength();
|
||||||
|
static NzString GetHashName();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzHashMD5_state* m_state;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_HASH_MD5
|
||||||
|
|
||||||
|
#endif // NAZARA_HASH_MD5_HPP
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#ifndef NAZARA_HASH_WHIRLPOOL_HPP
|
||||||
|
#define NAZARA_HASH_WHIRLPOOL_HPP
|
||||||
|
|
||||||
|
#define NAZARA_HASH_WHIRLPOOL
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/HashDigest.hpp>
|
||||||
|
#include <Nazara/Core/HashImpl.hpp>
|
||||||
|
|
||||||
|
struct NzHashWhirlpool_state;
|
||||||
|
|
||||||
|
class NAZARA_API NzHashWhirlpool : public NzHashImpl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzHashWhirlpool();
|
||||||
|
virtual ~NzHashWhirlpool();
|
||||||
|
|
||||||
|
void Append(const nzUInt8* data, unsigned int len);
|
||||||
|
void Begin();
|
||||||
|
NzHashDigest End();
|
||||||
|
|
||||||
|
static unsigned int GetDigestLength();
|
||||||
|
static NzString GetHashName();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzHashWhirlpool_state* m_state;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_HASH_WHIRLPOOL
|
||||||
|
|
||||||
|
#endif // NAZARA_HASH_WHIRLPOOL_HPP
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_HASHDIGEST_HPP
|
||||||
|
#define NAZARA_HASHDIGEST_HPP
|
||||||
|
|
||||||
|
#define NAZARA_HASHDIGEST
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <ostream>
|
||||||
|
|
||||||
|
class NAZARA_API NzHashDigest
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzHashDigest();
|
||||||
|
NzHashDigest(NzString hashName, const nzUInt8* digest, unsigned int length);
|
||||||
|
NzHashDigest(const NzHashDigest& rhs);
|
||||||
|
NzHashDigest(NzHashDigest&& rhs);
|
||||||
|
~NzHashDigest();
|
||||||
|
|
||||||
|
bool IsValid() const;
|
||||||
|
|
||||||
|
const nzUInt8* GetDigest() const;
|
||||||
|
unsigned int GetDigestLength() const;
|
||||||
|
NzString GetHashName() const;
|
||||||
|
|
||||||
|
NzString ToHex() const;
|
||||||
|
|
||||||
|
nzUInt8 operator[](unsigned short pos) const;
|
||||||
|
|
||||||
|
NzHashDigest& operator=(const NzHashDigest& rhs);
|
||||||
|
NzHashDigest& operator=(NzHashDigest&& rhs);
|
||||||
|
|
||||||
|
bool operator==(const NzHashDigest& rhs) const;
|
||||||
|
bool operator!=(const NzHashDigest& rhs) const;
|
||||||
|
bool operator<(const NzHashDigest& rhs) const;
|
||||||
|
bool operator<=(const NzHashDigest& rhs) const;
|
||||||
|
bool operator>(const NzHashDigest& rhs) const;
|
||||||
|
bool operator>=(const NzHashDigest& rhs) const;
|
||||||
|
|
||||||
|
NAZARA_API friend std::ostream& operator<<(std::ostream& out, const NzHashDigest& string);
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzString m_hashName;
|
||||||
|
nzUInt8* m_digest;
|
||||||
|
unsigned short m_digestLength;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_HASHDIGEST
|
||||||
|
|
||||||
|
#endif // NAZARA_HASHDIGEST_HPP
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_HASHIMPL_HPP
|
||||||
|
#define NAZARA_HASHIMPL_HPP
|
||||||
|
|
||||||
|
#define NAZARA_HASHIMPL
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
class NzHashDigest;
|
||||||
|
|
||||||
|
class NAZARA_API NzHashImpl : NzNonCopyable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzHashImpl() = default;
|
||||||
|
virtual ~NzHashImpl() {}
|
||||||
|
|
||||||
|
virtual void Append(const nzUInt8* data, unsigned int len) = 0;
|
||||||
|
virtual void Begin() = 0;
|
||||||
|
virtual NzHashDigest End() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_HASHIMPL
|
||||||
|
|
||||||
|
#endif // NAZARA_HASHIMPL_HPP
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef HASHABLE_HPP_INCLUDED
|
||||||
|
#define HASHABLE_HPP_INCLUDED
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
enum nzHash
|
||||||
|
{
|
||||||
|
nzHash_CRC32,
|
||||||
|
nzHash_Fletcher16,
|
||||||
|
nzHash_MD5,
|
||||||
|
nzHash_Whirlpool
|
||||||
|
};
|
||||||
|
|
||||||
|
class NzHash;
|
||||||
|
class NzHashDigest;
|
||||||
|
class NzHashImpl;
|
||||||
|
|
||||||
|
class NAZARA_API NzHashable
|
||||||
|
{
|
||||||
|
friend class NzHash;
|
||||||
|
|
||||||
|
public:
|
||||||
|
NzHashable() = default;
|
||||||
|
virtual ~NzHashable() {}
|
||||||
|
|
||||||
|
NzHashDigest GetHash(nzHash hash) const;
|
||||||
|
NzHashDigest GetHash(NzHashImpl* impl) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual bool FillHash(NzHashImpl* impl) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // HASHABLE_HPP_INCLUDED
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_LOCK_HPP
|
||||||
|
#define NAZARA_LOCK_HPP
|
||||||
|
|
||||||
|
#define NAZARA_LOCK
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
class NzMutex;
|
||||||
|
|
||||||
|
class NAZARA_API NzLock
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzLock(NzMutex& mutex);
|
||||||
|
~NzLock();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzMutex& m_mutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_LOCK
|
||||||
|
|
||||||
|
#endif // NAZARA_LOCK_HPP
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_LOG_HPP
|
||||||
|
#define NAZARA_LOG_HPP
|
||||||
|
|
||||||
|
#define NAZARA_LOG
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/Error.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <Nazara/Core/ThreadSafety.hpp>
|
||||||
|
#include <Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
#define NazaraLog NzLog::Instance()
|
||||||
|
|
||||||
|
class NzFile;
|
||||||
|
|
||||||
|
class NAZARA_API NzLog : NzNonCopyable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void Enable(bool enable);
|
||||||
|
void EnableAppend(bool enable);
|
||||||
|
void EnableDateTime(bool enable);
|
||||||
|
|
||||||
|
NzString GetFile() const;
|
||||||
|
|
||||||
|
bool IsEnabled() const;
|
||||||
|
|
||||||
|
void SetFile(const NzString& filePath);
|
||||||
|
|
||||||
|
void Write(const NzString& string);
|
||||||
|
void WriteError(nzErrorType type, const NzString& error, unsigned int line, const NzString& file, const NzString& func);
|
||||||
|
|
||||||
|
static NzLog* Instance();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzLog();
|
||||||
|
~NzLog();
|
||||||
|
|
||||||
|
NazaraMutexAttrib(m_mutex, mutable)
|
||||||
|
|
||||||
|
NzString m_filePath;
|
||||||
|
NzFile* m_file;
|
||||||
|
bool m_append;
|
||||||
|
bool m_enabled;
|
||||||
|
bool m_writeTime;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_LOGGER
|
||||||
|
|
||||||
|
#endif // NAZARA_LOGGER_HPP
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_MUTEX_HPP
|
||||||
|
#define NAZARA_MUTEX_HPP
|
||||||
|
|
||||||
|
#define NAZARA_MUTEX
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
class NzMutexImpl;
|
||||||
|
class NzThreadCondition;
|
||||||
|
|
||||||
|
class NAZARA_API NzMutex : NzNonCopyable
|
||||||
|
{
|
||||||
|
friend class NzThreadCondition;
|
||||||
|
|
||||||
|
public:
|
||||||
|
NzMutex();
|
||||||
|
~NzMutex();
|
||||||
|
|
||||||
|
void Lock();
|
||||||
|
bool TryLock();
|
||||||
|
void Unlock();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzMutexImpl* m_impl;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_MUTEX
|
||||||
|
|
||||||
|
#endif // NAZARA_MUTEX_HPP
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_SEMAPHORE_HPP
|
||||||
|
#define NAZARA_SEMAPHORE_HPP
|
||||||
|
|
||||||
|
#define NAZARA_SEMAPHORE
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
class NzSemaphoreImpl;
|
||||||
|
|
||||||
|
class NAZARA_API NzSemaphore : NzNonCopyable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzSemaphore(unsigned int count);
|
||||||
|
~NzSemaphore();
|
||||||
|
|
||||||
|
unsigned int GetCount() const;
|
||||||
|
void Post();
|
||||||
|
void Wait();
|
||||||
|
bool Wait(nzUInt32 timeout);
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzSemaphoreImpl* m_impl;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_SEMAPHORE
|
||||||
|
|
||||||
|
#endif // NAZARA_SEMAPHORE_HPP
|
||||||
|
|
@ -0,0 +1,323 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_STRING_HPP
|
||||||
|
#define NAZARA_STRING_HPP
|
||||||
|
|
||||||
|
#define NAZARA_STRING
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/Hashable.hpp>
|
||||||
|
#include <Nazara/Core/ThreadSafety.hpp>
|
||||||
|
#include <istream>
|
||||||
|
#include <ostream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class NzAbstractHash;
|
||||||
|
class NzHashDigest;
|
||||||
|
|
||||||
|
class NAZARA_API NzString : public NzHashable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum Flags
|
||||||
|
{
|
||||||
|
None = 0x00, // Mode par défaut
|
||||||
|
CaseInsensitive = 0x01, // Insensible à la casse
|
||||||
|
HandleUtf8 = 0x02 // Traite les octets comme une suite de caractères UTF-8
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SharedString;
|
||||||
|
|
||||||
|
NzString();
|
||||||
|
NzString(char character);
|
||||||
|
NzString(const char* string);
|
||||||
|
NzString(const std::string& string);
|
||||||
|
NzString(const NzString& string);
|
||||||
|
NzString(NzString&& string);
|
||||||
|
NzString(SharedString* sharedString);
|
||||||
|
~NzString();
|
||||||
|
|
||||||
|
NzString& Append(char character);
|
||||||
|
NzString& Append(const char* string);
|
||||||
|
NzString& Append(const NzString& string);
|
||||||
|
|
||||||
|
void Clear();
|
||||||
|
|
||||||
|
bool Contains(char character, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
bool Contains(const char* string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
bool Contains(const NzString& string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
unsigned int Count(char character, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int Count(const char* string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int Count(const NzString& string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int CountAny(const char* string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int CountAny(const NzString& string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
bool EndsWith(char character, nzUInt32 flags = None) const;
|
||||||
|
bool EndsWith(const char* string, nzUInt32 flags = None) const;
|
||||||
|
bool EndsWith(const NzString& string, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
unsigned int Find(char character, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int Find(const char* string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int Find(const NzString& string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindAny(const char* string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindAny(const NzString& string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindLast(char character, int start = -1, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindLast(const char *string, int start = -1, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindLast(const NzString& string, int start = -1, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindLastAny(const char* string, int start = -1, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindLastAny(const NzString& string, int start = -1, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindLastWord(const char* string, int start = -1, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindLastWord(const NzString& string, int start = -1, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindWord(const char* string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int FindWord(const NzString& string, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
char* GetBuffer();
|
||||||
|
unsigned int GetCapacity() const;
|
||||||
|
const char* GetConstBuffer() const;
|
||||||
|
unsigned int GetLength() const;
|
||||||
|
unsigned int GetSize() const;
|
||||||
|
char* GetUtf8Buffer(unsigned int* size = nullptr) const;
|
||||||
|
char16_t* GetUtf16Buffer(unsigned int* size = nullptr) const;
|
||||||
|
char32_t* GetUtf32Buffer(unsigned int* size = nullptr) const;
|
||||||
|
wchar_t* GetWideBuffer(unsigned int* size = nullptr) const;
|
||||||
|
|
||||||
|
NzString GetWord(unsigned int index, nzUInt32 flags = None) const;
|
||||||
|
unsigned int GetWordPosition(unsigned int index, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
NzString& Insert(int pos, char character);
|
||||||
|
NzString& Insert(int pos, const char* string);
|
||||||
|
NzString& Insert(int pos, const NzString& string);
|
||||||
|
|
||||||
|
bool IsEmpty() const;
|
||||||
|
bool IsNull() const;
|
||||||
|
bool IsNumber(nzUInt8 radix = 10, nzUInt32 flags = CaseInsensitive) const;
|
||||||
|
|
||||||
|
bool Match(const char* pattern) const;
|
||||||
|
bool Match(const NzString& pattern) const;
|
||||||
|
|
||||||
|
NzString& Prepend(char character);
|
||||||
|
NzString& Prepend(const char* string);
|
||||||
|
NzString& Prepend(const NzString& string);
|
||||||
|
|
||||||
|
unsigned int Replace(char oldCharacter, char newCharacter, int start = 0, nzUInt32 flags = None);
|
||||||
|
unsigned int Replace(const char* oldString, const char* replaceString, int start = 0, nzUInt32 flags = None);
|
||||||
|
unsigned int Replace(const NzString& oldString, const NzString& replaceString, int start = 0, nzUInt32 flags = None);
|
||||||
|
unsigned int ReplaceAny(const char* oldCharacters, char replaceCharacter, int start = 0, nzUInt32 flags = None);
|
||||||
|
unsigned int ReplaceAny(const char* oldCharacters, const char* replaceString, int start = 0, nzUInt32 flags = None);
|
||||||
|
unsigned int ReplaceAny(const NzString& oldCharacters, const NzString& replaceString, int start = 0, nzUInt32 flags = None);
|
||||||
|
|
||||||
|
void Reserve(unsigned int bufferSize);
|
||||||
|
|
||||||
|
NzString& Resize(int size, char character = ' ');
|
||||||
|
NzString Resized(int size, char character = ' ') const;
|
||||||
|
|
||||||
|
NzString& Reverse();
|
||||||
|
NzString Reversed() const;
|
||||||
|
|
||||||
|
NzString Simplified(nzUInt32 flags = None) const;
|
||||||
|
NzString& Simplify(nzUInt32 flags = None);
|
||||||
|
|
||||||
|
unsigned int Split(std::vector<NzString>& result, char separation = ' ', int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int Split(std::vector<NzString>& result, const char* separation, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int Split(std::vector<NzString>& result, const NzString& separation, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int SplitAny(std::vector<NzString>& result, const char* separations, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
unsigned int SplitAny(std::vector<NzString>& result, const NzString& separations, int start = 0, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
bool StartsWith(char character, nzUInt32 flags = None) const;
|
||||||
|
bool StartsWith(const char* string, nzUInt32 flags = None) const;
|
||||||
|
bool StartsWith(const NzString& string, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
NzString Substr(int startPos, int endPos = -1) const;
|
||||||
|
NzString SubstrFrom(char character, int startPos = 0, bool fromLast = false, bool include = false, nzUInt32 flags = None) const;
|
||||||
|
NzString SubstrFrom(const char *string, int startPos = 0, bool fromLast = false, bool include = false, nzUInt32 flags = None) const;
|
||||||
|
NzString SubstrFrom(const NzString& string, int startPos = 0, bool fromLast = false, bool include = false, nzUInt32 flags = None) const;
|
||||||
|
NzString SubstrTo(char character, int startPos = 0, bool toLast = false, bool include = false, nzUInt32 flags = None) const;
|
||||||
|
NzString SubstrTo(const char *string, int startPos = 0, bool toLast = false, bool include = false, nzUInt32 flags = None) const;
|
||||||
|
NzString SubstrTo(const NzString& string, int startPos = 0, bool toLast = false, bool include = false, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
void Swap(NzString& str);
|
||||||
|
|
||||||
|
bool ToBool(bool* value, nzUInt32 flags = None) const;
|
||||||
|
bool ToDouble(double* value) const;
|
||||||
|
bool ToInteger(long long* value, nzUInt8 radix = 10) const;
|
||||||
|
NzString ToLower(nzUInt32 flags = None) const;
|
||||||
|
NzString ToUpper(nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
NzString& Trim(nzUInt32 flags = None);
|
||||||
|
NzString& Trim(char character, nzUInt32 flags = None);
|
||||||
|
NzString Trimmed(nzUInt32 flags = None) const;
|
||||||
|
NzString Trimmed(char character, nzUInt32 flags = None) const;
|
||||||
|
|
||||||
|
// Méthodes compatibles STD
|
||||||
|
char* begin();
|
||||||
|
const char* begin() const;
|
||||||
|
char* end();
|
||||||
|
const char* end() const;
|
||||||
|
void push_front(char c);
|
||||||
|
void push_back(char c);
|
||||||
|
/*char* rbegin();
|
||||||
|
const char* rbegin() const;
|
||||||
|
char* rend();
|
||||||
|
const char* rend() const;*/
|
||||||
|
|
||||||
|
typedef const char& const_reference;
|
||||||
|
typedef char* iterator;
|
||||||
|
//typedef char* reverse_iterator;
|
||||||
|
typedef char value_type;
|
||||||
|
// Méthodes compatibles STD
|
||||||
|
|
||||||
|
operator std::string() const;
|
||||||
|
|
||||||
|
char& operator[](unsigned int pos);
|
||||||
|
char operator[](unsigned int pos) const;
|
||||||
|
|
||||||
|
NzString& operator=(char character);
|
||||||
|
NzString& operator=(const char* string);
|
||||||
|
NzString& operator=(const std::string& string);
|
||||||
|
NzString& operator=(const NzString& string);
|
||||||
|
NzString& operator=(NzString&& string);
|
||||||
|
|
||||||
|
NzString operator+(char character) const;
|
||||||
|
NzString operator+(const char* string) const;
|
||||||
|
NzString operator+(const std::string& string) const;
|
||||||
|
NzString operator+(const NzString& string) const;
|
||||||
|
|
||||||
|
NzString& operator+=(char character);
|
||||||
|
NzString& operator+=(const char* string);
|
||||||
|
NzString& operator+=(const std::string& string);
|
||||||
|
NzString& operator+=(const NzString& string);
|
||||||
|
|
||||||
|
bool operator==(char character) const;
|
||||||
|
bool operator==(const char* string) const;
|
||||||
|
bool operator==(const std::string& string) const;
|
||||||
|
|
||||||
|
bool operator!=(char character) const;
|
||||||
|
bool operator!=(const char* string) const;
|
||||||
|
bool operator!=(const std::string& string) const;
|
||||||
|
|
||||||
|
bool operator<(char character) const;
|
||||||
|
bool operator<(const char* string) const;
|
||||||
|
bool operator<(const std::string& string) const;
|
||||||
|
|
||||||
|
bool operator<=(char character) const;
|
||||||
|
bool operator<=(const char* string) const;
|
||||||
|
bool operator<=(const std::string& string) const;
|
||||||
|
|
||||||
|
bool operator>(char character) const;
|
||||||
|
bool operator>(const char* string) const;
|
||||||
|
bool operator>(const std::string& string) const;
|
||||||
|
|
||||||
|
bool operator>=(char character) const;
|
||||||
|
bool operator>=(const char* string) const;
|
||||||
|
bool operator>=(const std::string& string) const;
|
||||||
|
|
||||||
|
static NzString Boolean(bool boolean);
|
||||||
|
static int Compare(const NzString& first, const NzString& second);
|
||||||
|
static NzString Number(float number);
|
||||||
|
static NzString Number(double number);
|
||||||
|
static NzString Number(long double number);
|
||||||
|
static NzString Number(signed char number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(unsigned char number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(short number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(unsigned short number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(int number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(unsigned int number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(long number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(unsigned long number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(long long number, nzUInt8 radix = 10);
|
||||||
|
static NzString Number(unsigned long long number, nzUInt8 radix = 10);
|
||||||
|
static NzString Pointer(const void* ptr);
|
||||||
|
static NzString Unicode(char32_t character);
|
||||||
|
static NzString Unicode(const char* u8String);
|
||||||
|
static NzString Unicode(const char16_t* u16String);
|
||||||
|
static NzString Unicode(const char32_t* u32String);
|
||||||
|
static NzString Unicode(const wchar_t* wString);
|
||||||
|
|
||||||
|
NAZARA_API friend std::istream& operator>>(std::istream& in, NzString& string);
|
||||||
|
NAZARA_API friend std::ostream& operator<<(std::ostream& out, const NzString& string);
|
||||||
|
|
||||||
|
NAZARA_API friend NzString operator+(char character, const NzString& string);
|
||||||
|
NAZARA_API friend NzString operator+(const char* string, const NzString& nstring);
|
||||||
|
NAZARA_API friend NzString operator+(const std::string& string, const NzString& nstring);
|
||||||
|
|
||||||
|
NAZARA_API friend bool operator==(const NzString& first, const NzString& second);
|
||||||
|
NAZARA_API friend bool operator!=(const NzString& first, const NzString& second);
|
||||||
|
NAZARA_API friend bool operator<(const NzString& first, const NzString& second);
|
||||||
|
NAZARA_API friend bool operator<=(const NzString& first, const NzString& second);
|
||||||
|
NAZARA_API friend bool operator>(const NzString& first, const NzString& second);
|
||||||
|
NAZARA_API friend bool operator>=(const NzString& first, const NzString& second);
|
||||||
|
|
||||||
|
NAZARA_API friend bool operator==(char character, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator==(const char* string, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator==(const std::string& string, const NzString& nstring);
|
||||||
|
|
||||||
|
NAZARA_API friend bool operator!=(char character, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator!=(const char* string, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator!=(const std::string& string, const NzString& nstring);
|
||||||
|
|
||||||
|
NAZARA_API friend bool operator<(char character, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator<(const char* string, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator<(const std::string& string, const NzString& nstring);
|
||||||
|
|
||||||
|
NAZARA_API friend bool operator<=(char character, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator<=(const char* string, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator<=(const std::string& string, const NzString& nstring);
|
||||||
|
|
||||||
|
NAZARA_API friend bool operator>(char character, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator>(const char* string, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator>(const std::string& string, const NzString& nstring);
|
||||||
|
|
||||||
|
NAZARA_API friend bool operator>=(char character, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator>=(const char* string, const NzString& nstring);
|
||||||
|
NAZARA_API friend bool operator>=(const std::string& string, const NzString& nstring);
|
||||||
|
|
||||||
|
struct NAZARA_API SharedString
|
||||||
|
{
|
||||||
|
SharedString() :
|
||||||
|
refCount(1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
SharedString(unsigned int bufferSize, unsigned int stringSize, unsigned short referenceCount, char* str) :
|
||||||
|
allocatedSize(bufferSize),
|
||||||
|
size(stringSize),
|
||||||
|
refCount(referenceCount),
|
||||||
|
string(str)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int allocatedSize;
|
||||||
|
unsigned int size;
|
||||||
|
unsigned short refCount;
|
||||||
|
char* string;
|
||||||
|
|
||||||
|
NazaraMutex(mutex)
|
||||||
|
};
|
||||||
|
|
||||||
|
static SharedString emptyString;
|
||||||
|
static unsigned int npos;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void EnsureOwnership();
|
||||||
|
bool FillHash(NzHashImpl* hash) const;
|
||||||
|
void ReleaseString();
|
||||||
|
|
||||||
|
SharedString* m_sharedString;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
NAZARA_API istream& getline(istream& is, NzString& str);
|
||||||
|
NAZARA_API istream& getline(istream& is, NzString& str, char delim);
|
||||||
|
NAZARA_API void swap(NzString& lhs, NzString& rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef NAZARA_STRING
|
||||||
|
|
||||||
|
#endif // NAZARA_STRING_HPP
|
||||||
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_STRINGSTREAM_HPP
|
||||||
|
#define NAZARA_STRINGSTREAM_HPP
|
||||||
|
|
||||||
|
#define NAZARA_STRINGSTREAM
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <Nazara/Core/ThreadSafety.hpp>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class NAZARA_API NzStringStream
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzStringStream();
|
||||||
|
NzStringStream(const NzString& str);
|
||||||
|
|
||||||
|
NzString ToString() const;
|
||||||
|
|
||||||
|
NzStringStream& operator<<(bool boolean);
|
||||||
|
NzStringStream& operator<<(short number);
|
||||||
|
NzStringStream& operator<<(unsigned short number);
|
||||||
|
NzStringStream& operator<<(int number);
|
||||||
|
NzStringStream& operator<<(unsigned int number);
|
||||||
|
NzStringStream& operator<<(long number);
|
||||||
|
NzStringStream& operator<<(unsigned long number);
|
||||||
|
NzStringStream& operator<<(long long number);
|
||||||
|
NzStringStream& operator<<(unsigned long long number);
|
||||||
|
NzStringStream& operator<<(float number);
|
||||||
|
NzStringStream& operator<<(double number);
|
||||||
|
NzStringStream& operator<<(long double number);
|
||||||
|
NzStringStream& operator<<(char character);
|
||||||
|
NzStringStream& operator<<(unsigned char character);
|
||||||
|
NzStringStream& operator<<(const char* string);
|
||||||
|
NzStringStream& operator<<(const std::string& string);
|
||||||
|
NzStringStream& operator<<(const NzString& string);
|
||||||
|
NzStringStream& operator<<(const void* ptr);
|
||||||
|
|
||||||
|
operator NzString() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
NazaraMutexAttrib(m_mutex, mutable)
|
||||||
|
|
||||||
|
std::vector<NzString> m_strings;
|
||||||
|
unsigned int m_bufferSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_STRINGSTREAM
|
||||||
|
|
||||||
|
#endif // NAZARA_STRINGSTREAM_HPP
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
// Inspiré du code de la SFML par Laurent Gomila
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_THREAD_HPP
|
||||||
|
#define NAZARA_THREAD_HPP
|
||||||
|
|
||||||
|
#define NAZARA_THREAD
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Utility/Functor.hpp>
|
||||||
|
#include <Nazara/Utility/NonCopyable.hpp>
|
||||||
|
|
||||||
|
class NzThreadImpl;
|
||||||
|
|
||||||
|
class NAZARA_API NzThread : NzNonCopyable
|
||||||
|
{
|
||||||
|
friend class NzThreadImpl;
|
||||||
|
|
||||||
|
public:
|
||||||
|
class NAZARA_API Id
|
||||||
|
{
|
||||||
|
friend class NzThread;
|
||||||
|
friend class NzThreadImpl;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Id() : m_handle(nullptr) {}
|
||||||
|
Id(Id&& rhs) = default;
|
||||||
|
~Id();
|
||||||
|
|
||||||
|
Id& operator=(Id&& rhs) = default;
|
||||||
|
bool operator==(const Id& rhs) const;
|
||||||
|
bool operator!=(const Id& rhs) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Id(void* handle) : m_handle(handle) {}
|
||||||
|
Id(const NzThreadImpl* thread);
|
||||||
|
|
||||||
|
void* m_handle;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename F> NzThread(F function);
|
||||||
|
template<typename F, typename... Args> NzThread(F function, Args... args);
|
||||||
|
~NzThread();
|
||||||
|
|
||||||
|
Id GetId() const;
|
||||||
|
bool IsCurrent() const;
|
||||||
|
void Launch(bool independent = false);
|
||||||
|
void Join();
|
||||||
|
void Terminate();
|
||||||
|
|
||||||
|
static Id GetCurrentId();
|
||||||
|
static void Sleep(nzUInt32 time);
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzFunctor* m_func;
|
||||||
|
NzThreadImpl* m_impl;
|
||||||
|
bool m_independent;
|
||||||
|
};
|
||||||
|
|
||||||
|
#include <Nazara/Core/Thread.inl>
|
||||||
|
|
||||||
|
#undef NAZARA_THREAD
|
||||||
|
|
||||||
|
#endif // NAZARA_THREAD_HPP
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
template<typename F> NzThread::NzThread(F function) :
|
||||||
|
m_func(new NzFunctorWithoutArgs<F>(function)),
|
||||||
|
m_impl(nullptr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename F, typename... Args> NzThread::NzThread(F function, Args... args) :
|
||||||
|
m_func(new NzFunctorWithArgs<F, Args...>(function, args...)),
|
||||||
|
m_impl(nullptr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_THREADCONDITION_HPP
|
||||||
|
#define NAZARA_THREADCONDITION_HPP
|
||||||
|
|
||||||
|
#define NAZARA_THREADCONDITION
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
class NzMutex;
|
||||||
|
class NzThreadConditionImpl;
|
||||||
|
|
||||||
|
class NAZARA_API NzThreadCondition
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzThreadCondition();
|
||||||
|
~NzThreadCondition();
|
||||||
|
|
||||||
|
void Signal();
|
||||||
|
void SignalAll();
|
||||||
|
|
||||||
|
void Wait(NzMutex* mutex);
|
||||||
|
bool Wait(NzMutex* mutex, nzUInt32 timeout);
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzThreadConditionImpl* m_impl;
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef NAZARA_THREADCONDITION
|
||||||
|
|
||||||
|
#endif // NAZARA_THREADCONDITION_HPP
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
// Pas de header guard
|
||||||
|
|
||||||
|
#include <Nazara/Core/Config.hpp>
|
||||||
|
|
||||||
|
#undef NazaraLock
|
||||||
|
#undef NazaraMutex
|
||||||
|
#undef NazaraMutexAttrib
|
||||||
|
#undef NazaraMutexLock
|
||||||
|
#undef NazaraMutexUnlock
|
||||||
|
#undef NazaraNamedLock
|
||||||
|
|
||||||
|
#if NAZARA_CORE_THREADSAFE && (\
|
||||||
|
(NAZARA_THREADSAFETY_BYTEARRAY && (defined(NAZARA_BYTEARRAY) || defined(NAZARA_BYTEARRAY_CPP))) || \
|
||||||
|
(NAZARA_THREADSAFETY_CLOCK && (defined(NAZARA_CLOCK) || defined(NAZARA_CLOCK_CPP))) || \
|
||||||
|
(NAZARA_THREADSAFETY_DIRECTORY && (defined(NAZARA_DIRECTORY) || defined(NAZARA_DIRECTORY_CPP))) || \
|
||||||
|
(NAZARA_THREADSAFETY_DYNLIB && (defined(NAZARA_DYNLIB) || defined(NAZARA_DYNLIB_CPP))) || \
|
||||||
|
(NAZARA_THREADSAFETY_FILE && (defined(NAZARA_FILE) || defined(NAZARA_FILE_CPP))) || \
|
||||||
|
(NAZARA_THREADSAFETY_HASHDIGEST && (defined(NAZARA_HASHDIGEST) || defined(NAZARA_HASHDIGEST_CPP))) || \
|
||||||
|
(NAZARA_THREADSAFETY_LOG && (defined(NAZARA_LOG) || defined(NAZARA_LOG_CPP))) || \
|
||||||
|
(NAZARA_THREADSAFETY_STRING && (defined(NAZARA_STRING) || defined(NAZARA_STRING_CPP))) || \
|
||||||
|
(NAZARA_THREADSAFETY_STRINGSTREAM && (defined(NAZARA_STRINGSTREAM) || defined(NAZARA_STRINGSTREAM_CPP))))
|
||||||
|
|
||||||
|
#include <Nazara/Core/Lock.hpp>
|
||||||
|
#include <Nazara/Core/Mutex.hpp>
|
||||||
|
|
||||||
|
#define NazaraLock(mutex) NzLock lock_mutex(mutex);
|
||||||
|
#define NazaraMutex(name) NzMutex name;
|
||||||
|
#define NazaraMutexAttrib(name, attribute) attribute NzMutex name;
|
||||||
|
#define NazaraMutexLock(mutex) mutex.Lock();
|
||||||
|
#define NazaraMutexUnlock(mutex) mutex.Unlock();
|
||||||
|
#define NazaraNamedLock(mutex, name) NzLock lock_##name(mutex);
|
||||||
|
#else
|
||||||
|
#define NazaraLock(mutex)
|
||||||
|
#define NazaraMutex(name)
|
||||||
|
#define NazaraMutexAttrib(name, attribute)
|
||||||
|
#define NazaraMutexLock(mutex)
|
||||||
|
#define NazaraMutexUnlock(mutex)
|
||||||
|
#define NazaraNamedLock(mutex, name)
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_UNICODE_HPP
|
||||||
|
#define NAZARA_UNICODE_HPP
|
||||||
|
|
||||||
|
#define NAZARA_UNICODE
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
|
||||||
|
namespace NzUnicode
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Catégorie Unicode:
|
||||||
|
-Les valeurs de 0x01 à 0x80 indiquent la catégorie.
|
||||||
|
-Les valeurs de 0x100 à 0x10000 indiquent la sous-catégorie.
|
||||||
|
*/
|
||||||
|
enum Category : nzUInt16
|
||||||
|
{
|
||||||
|
// Catégorie non-reconnue par Nazara
|
||||||
|
Category_NoCategory = 0,
|
||||||
|
|
||||||
|
// Lettres
|
||||||
|
Category_Letter = 0x01, // L
|
||||||
|
Category_Letter_Lowercase = Category_Letter | 0x0100, // Ll
|
||||||
|
Category_Letter_Modifier = Category_Letter | 0x0200, // Lm
|
||||||
|
Category_Letter_Other = Category_Letter | 0x0400, // Lo
|
||||||
|
Category_Letter_Titlecase = Category_Letter | 0x0800, // Lt
|
||||||
|
Category_Letter_Uppercase = Category_Letter | 0x1000, // Lu
|
||||||
|
|
||||||
|
// Marques
|
||||||
|
Category_Mark = 0x02, // M
|
||||||
|
Category_Mark_Enclosing = Category_Mark | 0x100, // Me
|
||||||
|
Category_Mark_NonSpacing = Category_Mark | 0x200, // Mn
|
||||||
|
Category_Mark_SpacingCombining = Category_Mark | 0x400, // Mc
|
||||||
|
|
||||||
|
// Nombres
|
||||||
|
Category_Number = 0x04, // N
|
||||||
|
Category_Number_DecimalDigit = Category_Number | 0x100, // Nd
|
||||||
|
Category_Number_Letter = Category_Number | 0x200, // Nl
|
||||||
|
Category_Number_Other = Category_Number | 0x400, // No
|
||||||
|
|
||||||
|
// Autres
|
||||||
|
Category_Other = 0x08, // C
|
||||||
|
Category_Other_Control = Category_Other | 0x0100, // Cc
|
||||||
|
Category_Other_Format = Category_Other | 0x0200, // Cf
|
||||||
|
Category_Other_NotAssigned = Category_Other | 0x0400, // Cn
|
||||||
|
Category_Other_PrivateUse = Category_Other | 0x0800, // Co
|
||||||
|
Category_Other_Surrogate = Category_Other | 0x1000, // Cs
|
||||||
|
|
||||||
|
// Ponctuations
|
||||||
|
Category_Punctuation = 0x10, // P
|
||||||
|
Category_Punctuation_Close = Category_Punctuation | 0x0100, // Pe
|
||||||
|
Category_Punctuation_Connector = Category_Punctuation | 0x0200, // Pc
|
||||||
|
Category_Punctuation_Dash = Category_Punctuation | 0x0400, // Pd
|
||||||
|
Category_Punctuation_FinalQuote = Category_Punctuation | 0x0800, // Pf
|
||||||
|
Category_Punctuation_InitialQuote = Category_Punctuation | 0x1000, // Pi
|
||||||
|
Category_Punctuation_Open = Category_Punctuation | 0x2000, // Ps
|
||||||
|
Category_Punctuation_Other = Category_Punctuation | 0x4000, // Po
|
||||||
|
|
||||||
|
// Espacements
|
||||||
|
Category_Separator = 0x20, // Z
|
||||||
|
Category_Separator_Line = Category_Separator | 0x0100, // Zl
|
||||||
|
Category_Separator_Paragraph = Category_Separator | 0x0200, // Zp
|
||||||
|
Category_Separator_Space = Category_Separator | 0x0400, // Zs
|
||||||
|
|
||||||
|
// Symboles
|
||||||
|
Category_Symbol = 0x40, // S
|
||||||
|
Category_Symbol_Currency = Category_Symbol | 0x0100, // Sc
|
||||||
|
Category_Symbol_Math = Category_Symbol | 0x0200, // Sm
|
||||||
|
Category_Symbol_Modifier = Category_Symbol | 0x0400, // Sk
|
||||||
|
Category_Symbol_Other = Category_Symbol | 0x0800 // So
|
||||||
|
};
|
||||||
|
|
||||||
|
enum Direction : nzUInt8
|
||||||
|
{
|
||||||
|
Direction_Arabic_Letter, // AL
|
||||||
|
Direction_Arabic_Number, // AN
|
||||||
|
Direction_Boundary_Neutral, // BN
|
||||||
|
Direction_Common_Separator, // CS
|
||||||
|
Direction_European_Number, // EN
|
||||||
|
Direction_European_Separator, // ES
|
||||||
|
Direction_European_Terminator, // ET
|
||||||
|
Direction_Left_To_Right, // L
|
||||||
|
Direction_Left_To_Right_Embedding, // LRE
|
||||||
|
Direction_Left_To_Right_Override, // LRO
|
||||||
|
Direction_Nonspacing_Mark, // NSM
|
||||||
|
Direction_Other_Neutral, // ON
|
||||||
|
Direction_Paragraph_Separator, // B
|
||||||
|
Direction_Pop_Directional_Format, // PDF
|
||||||
|
Direction_Right_To_Left, // R
|
||||||
|
Direction_Right_To_Left_Embedding, // RLE
|
||||||
|
Direction_Right_To_Left_Override, // RLO
|
||||||
|
Direction_Segment_Separator, // S
|
||||||
|
Direction_White_Space // WS
|
||||||
|
};
|
||||||
|
|
||||||
|
Category GetCategory(char32_t character);
|
||||||
|
Direction GetDirection(char32_t character);
|
||||||
|
char32_t GetLowercase(char32_t character);
|
||||||
|
char32_t GetTitlecase(char32_t character);
|
||||||
|
char32_t GetUppercase(char32_t character);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef NAZARA_UNICODE
|
||||||
|
|
||||||
|
#endif // NAZARA_UNICODE_HPP
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_BASIC_HPP
|
||||||
|
#define NAZARA_BASIC_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Core/Config.hpp>
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
#ifndef M_PI
|
||||||
|
#define M_PI 3.141592653589793238462643
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef M_SQRT2
|
||||||
|
#define M_SQRT2 1.4142135623730950488016887
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<typename T> T NzApproach(T value, T objective, T increment);
|
||||||
|
template<typename T> T NzClamp(T value, T min, T max);
|
||||||
|
template<typename T> T NzDegrees(T degrees);
|
||||||
|
template<typename T> T NzDegreeToRadian(T degrees);
|
||||||
|
inline unsigned int NzGetNumberLength(signed char number);
|
||||||
|
inline unsigned int NzGetNumberLength(unsigned char number);
|
||||||
|
inline unsigned int NzGetNumberLength(short number);
|
||||||
|
inline unsigned int NzGetNumberLength(unsigned short number);
|
||||||
|
inline unsigned int NzGetNumberLength(int number);
|
||||||
|
inline unsigned int NzGetNumberLength(unsigned int number);
|
||||||
|
inline unsigned int NzGetNumberLength(long number);
|
||||||
|
inline unsigned int NzGetNumberLength(unsigned long number);
|
||||||
|
inline unsigned int NzGetNumberLength(long long number);
|
||||||
|
inline unsigned int NzGetNumberLength(unsigned long long number);
|
||||||
|
inline unsigned int NzGetNumberLength(float number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION);
|
||||||
|
inline unsigned int NzGetNumberLength(double number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION);
|
||||||
|
inline unsigned int NzGetNumberLength(long double number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION);
|
||||||
|
template<typename T> T NzNormalizeAngle(T angle);
|
||||||
|
template<typename T> bool NzNumberEquals(T a, T b);
|
||||||
|
inline NzString NzNumberToString(long long number, nzUInt8 radix = 10);
|
||||||
|
template<typename T> T NzRadians(T radians);
|
||||||
|
template<typename T> T NzRadianToDegree(T radians);
|
||||||
|
inline long long NzStringToNumber(NzString str, nzUInt8 radix = 10);
|
||||||
|
|
||||||
|
#include <Nazara/Math/Basic.inl>
|
||||||
|
|
||||||
|
#endif // NAZARA_BASIC_HPP
|
||||||
|
|
@ -0,0 +1,279 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Error.hpp>
|
||||||
|
#include <Nazara/Math/Config.hpp>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzApproach(T value, T objective, T increment)
|
||||||
|
{
|
||||||
|
if (value < objective)
|
||||||
|
return std::min(value + increment, objective);
|
||||||
|
else if (value > objective)
|
||||||
|
return std::max(value - increment, objective);
|
||||||
|
else
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzClamp(T value, T min, T max)
|
||||||
|
{
|
||||||
|
if (value < min)
|
||||||
|
return min;
|
||||||
|
else if (value > max)
|
||||||
|
return max;
|
||||||
|
else
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzDegrees(T degrees)
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_ANGLE_RADIAN
|
||||||
|
return NzDegreeToRadian(degrees);
|
||||||
|
#else
|
||||||
|
return degrees;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzDegreeToRadian(T degrees)
|
||||||
|
{
|
||||||
|
return degrees * (M_PI/180.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(signed char number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(std::abs(number)))+(number < 0 ? 2 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(unsigned char number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(number))+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(short number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(std::abs(number)))+(number < 0 ? 2 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(unsigned short number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(number))+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(int number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(std::abs(number)))+(number < 0 ? 2 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(unsigned int number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(number))+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(long number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(std::abs(number)))+(number < 0 ? 2 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(unsigned long number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(number))+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(long long number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(std::abs(number)))+(number < 0 ? 2 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(unsigned long long number)
|
||||||
|
{
|
||||||
|
if (number == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return static_cast<unsigned int>(std::log10(number))+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(float number, nzUInt8 precision)
|
||||||
|
{
|
||||||
|
// L'imprécision des flottants nécessite un cast (log10(9.99999) = 1)
|
||||||
|
return NzGetNumberLength(static_cast<long long>(number)) + precision + 1; // Plus un pour le point
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(double number, nzUInt8 precision)
|
||||||
|
{
|
||||||
|
// L'imprécision des flottants nécessite un cast (log10(9.99999) = 1)
|
||||||
|
return NzGetNumberLength(static_cast<long long>(number)) + precision + 1; // Plus un pour le point
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int NzGetNumberLength(long double number, nzUInt8 precision)
|
||||||
|
{
|
||||||
|
// L'imprécision des flottants nécessite un cast (log10(9.99999) = 1)
|
||||||
|
return NzGetNumberLength(static_cast<long long>(number)) + precision + 1; // Plus un pour le point
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzNormalizeAngle(T angle)
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_ANGLE_RADIAN
|
||||||
|
const T limit = M_PI;
|
||||||
|
#else
|
||||||
|
const T limit = 180.0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
///TODO: Trouver une solution sans duplication
|
||||||
|
if (angle > 0.0)
|
||||||
|
{
|
||||||
|
angle += limit;
|
||||||
|
angle -= static_cast<int>(angle/(2.0*limit))*(2.0*limit);
|
||||||
|
angle -= limit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
angle -= limit;
|
||||||
|
angle -= static_cast<int>(angle/(2.0*limit))*(2.0*limit);
|
||||||
|
angle += limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return angle;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzNumberEquals(T a, T b)
|
||||||
|
{
|
||||||
|
if (a > b)
|
||||||
|
return (a-b) <= std::numeric_limits<T>::epsilon();
|
||||||
|
else
|
||||||
|
return (b-a) <= std::numeric_limits<T>::epsilon();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
NzString NzNumberToString(long long number, nzUInt8 radix)
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_SAFE
|
||||||
|
if (radix < 2 || radix > 36)
|
||||||
|
{
|
||||||
|
NazaraError("Base must be between 2 and 36");
|
||||||
|
return NzString();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (number == 0)
|
||||||
|
return '0';
|
||||||
|
|
||||||
|
static const char* symbols("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||||
|
|
||||||
|
bool negative;
|
||||||
|
if (number < 0)
|
||||||
|
{
|
||||||
|
negative = true;
|
||||||
|
number = -number;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
negative = false;
|
||||||
|
|
||||||
|
NzString str;
|
||||||
|
str.Reserve(NzGetNumberLength(number));
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
str += symbols[number % radix];
|
||||||
|
number /= radix;
|
||||||
|
}
|
||||||
|
while (number > 0);
|
||||||
|
|
||||||
|
if (negative)
|
||||||
|
str += '-';
|
||||||
|
|
||||||
|
return str.Reversed();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzRadians(T radians)
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_ANGLE_RADIAN
|
||||||
|
return radians;
|
||||||
|
#else
|
||||||
|
return NzRadianToDegree(radians);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzRadianToDegree(T radians)
|
||||||
|
{
|
||||||
|
return radians * (180.0/M_PI);
|
||||||
|
}
|
||||||
|
|
||||||
|
long long NzStringToNumber(NzString str, nzUInt8 radix)
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_SAFE
|
||||||
|
if (radix < 2 || radix > 36)
|
||||||
|
{
|
||||||
|
NazaraError("Radix must be between 2 and 36");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
str.Simplify();
|
||||||
|
if (radix > 10)
|
||||||
|
str.ToUpper();
|
||||||
|
|
||||||
|
bool negative = str.StartsWith('-');
|
||||||
|
static const char* symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
|
||||||
|
char* digit = &str[(negative) ? 1 : 0];
|
||||||
|
unsigned long long total = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (*digit == ' ')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
total *= radix;
|
||||||
|
const char* c = std::strchr(symbols, *digit);
|
||||||
|
if (c && c-symbols < radix)
|
||||||
|
total += c-symbols;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NazaraError("str is not a valid number");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (*++digit);
|
||||||
|
|
||||||
|
return (negative) ? -static_cast<long long>(total) : total;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
Nazara Engine
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
Rémi "overdrivr" Begues (remi.beges@laposte.net)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CONFIG_MATH_HPP
|
||||||
|
#define NAZARA_CONFIG_MATH_HPP
|
||||||
|
|
||||||
|
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||||
|
|
||||||
|
// Définit le radian comme l'unité utilisée pour les angles
|
||||||
|
#define NAZARA_MATH_ANGLE_RADIAN 0
|
||||||
|
|
||||||
|
// Définit la disposition des matrices en colonnes
|
||||||
|
#define NAZARA_MATH_MATRIX_COLUMN_MAJOR 1
|
||||||
|
|
||||||
|
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||||
|
#define NAZARA_MATH_SAFE 1
|
||||||
|
|
||||||
|
#endif // NAZARA_CONFIG_MATH_HPP
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
// Copyright (C) 2012 Rémi Begues
|
||||||
|
// Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_EULERANGLES_HPP
|
||||||
|
#define NAZARA_EULERANGLES_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
template<typename T> class NzQuaternion;
|
||||||
|
template<typename T> class NzVector3;
|
||||||
|
|
||||||
|
template<typename T> class NzEulerAngles
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzEulerAngles();
|
||||||
|
NzEulerAngles(T P, T Y, T R);
|
||||||
|
NzEulerAngles(T angles[3]);
|
||||||
|
//NzEulerAngles(const NzMatrix3<T>& mat);
|
||||||
|
NzEulerAngles(const NzQuaternion<T>& quat);
|
||||||
|
template<typename U> explicit NzEulerAngles(const NzEulerAngles<U>& angles);
|
||||||
|
NzEulerAngles(const NzEulerAngles& angles) = default;
|
||||||
|
~NzEulerAngles() = default;
|
||||||
|
|
||||||
|
NzVector3<T> GetForward() const;
|
||||||
|
NzVector3<T> GetRight() const;
|
||||||
|
NzVector3<T> GetUp() const;
|
||||||
|
|
||||||
|
void Normalize();
|
||||||
|
|
||||||
|
void Set(T P, T Y, T R);
|
||||||
|
void Set(T angles[3]);
|
||||||
|
void Set(const NzEulerAngles<T>& angles);
|
||||||
|
//void Set(const NzMatrix3<T>& mat);
|
||||||
|
void Set(const NzQuaternion<T>& quat);
|
||||||
|
template<typename U> void Set(const NzEulerAngles<U>& angles);
|
||||||
|
void SetZero();
|
||||||
|
|
||||||
|
//NzEulerAngles<T> ToEulerAngles() const;
|
||||||
|
//NzMatrix3<T> ToRotationMatrix() const;
|
||||||
|
NzQuaternion<T> ToQuaternion() const;
|
||||||
|
NzString ToString() const;
|
||||||
|
|
||||||
|
NzEulerAngles operator+(const NzEulerAngles& angles) const;
|
||||||
|
NzEulerAngles operator-(const NzEulerAngles& angles) const;
|
||||||
|
NzEulerAngles operator*(const NzEulerAngles& angles) const;
|
||||||
|
NzEulerAngles operator/(const NzEulerAngles& angles) const;
|
||||||
|
|
||||||
|
NzEulerAngles operator+=(const NzEulerAngles& angles);
|
||||||
|
NzEulerAngles operator-=(const NzEulerAngles& angles);
|
||||||
|
NzEulerAngles operator*=(const NzEulerAngles& angles);
|
||||||
|
NzEulerAngles operator/=(const NzEulerAngles& angles);
|
||||||
|
|
||||||
|
bool operator==(const NzEulerAngles& angles) const;
|
||||||
|
bool operator!=(const NzEulerAngles& angles) const;
|
||||||
|
|
||||||
|
T pitch, yaw, roll;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> std::ostream& operator<<(std::ostream& out, const NzEulerAngles<T>& angles);
|
||||||
|
|
||||||
|
typedef NzEulerAngles<double> NzEulerAnglesd;
|
||||||
|
typedef NzEulerAngles<float> NzEulerAnglesf;
|
||||||
|
|
||||||
|
#include <Nazara/Math/EulerAngles.inl>
|
||||||
|
|
||||||
|
#endif // NAZARA_EULERANGLES_HPP
|
||||||
|
|
@ -0,0 +1,199 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
|
#include <Nazara/Math/Basic.hpp>
|
||||||
|
#include <Nazara/Math/Quaternion.hpp>
|
||||||
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
|
#include <cmath>
|
||||||
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T>::NzEulerAngles()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T>::NzEulerAngles(T P, T Y, T R)
|
||||||
|
{
|
||||||
|
Set(P, Y, R);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T>::NzEulerAngles(T angles[3])
|
||||||
|
{
|
||||||
|
Set(angles);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T>::NzEulerAngles(const NzQuaternion<T>& quat)
|
||||||
|
{
|
||||||
|
Set(quat);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
NzEulerAngles<T>::NzEulerAngles(const NzEulerAngles<U>& angles)
|
||||||
|
{
|
||||||
|
Set(angles);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzEulerAngles<T>::GetForward() const
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_ANGLE_RADIAN
|
||||||
|
return NzVector3<T>(std::cos(yaw), std::sin(roll), std::sin(yaw));
|
||||||
|
#else
|
||||||
|
return NzVector3<T>(std::cos(NzDegreeToRadian(yaw)), std::sin(NzDegreeToRadian(roll)), std::sin(NzDegreeToRadian(yaw)));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzEulerAngles<T>::GetRight() const
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_ANGLE_RADIAN
|
||||||
|
return NzVector3<T>(std::sin(yaw), std::sin(pitch), std::cos(pitch));
|
||||||
|
#else
|
||||||
|
return NzVector3<T>(std::sin(NzDegreeToRadian(yaw)), std::sin(NzDegreeToRadian(pitch)), std::cos(NzDegreeToRadian(pitch)));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzEulerAngles<T>::GetUp() const
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_ANGLE_RADIAN
|
||||||
|
return NzVector3<T>(std::sin(roll), std::cos(pitch), -std::sin(pitch));
|
||||||
|
#else
|
||||||
|
return NzVector3<T>(std::sin(NzDegreeToRadian(roll)), std::cos(NzDegreeToRadian(pitch)), -std::sin(NzDegreeToRadian(pitch)));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzEulerAngles<T>::Normalize()
|
||||||
|
{
|
||||||
|
pitch = NzNormalizeAngle(pitch);
|
||||||
|
yaw = NzNormalizeAngle(yaw);
|
||||||
|
roll = NzNormalizeAngle(roll);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzEulerAngles<T>::Set(T P, T Y, T R)
|
||||||
|
{
|
||||||
|
pitch = P;
|
||||||
|
yaw = Y;
|
||||||
|
roll = R;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzEulerAngles<T>::Set(T angles[3])
|
||||||
|
{
|
||||||
|
pitch = angles[0];
|
||||||
|
yaw = angles[1];
|
||||||
|
roll = angles[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzEulerAngles<T>::Set(const NzEulerAngles& angles)
|
||||||
|
{
|
||||||
|
pitch = angles.pitch;
|
||||||
|
yaw = angles.yaw;
|
||||||
|
roll = angles.roll;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzEulerAngles<T>::Set(const NzQuaternion<T>& quat)
|
||||||
|
{
|
||||||
|
Set(quat.ToEulerAngles());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
void NzEulerAngles<T>::Set(const NzEulerAngles<U>& angles)
|
||||||
|
{
|
||||||
|
pitch = static_cast<T>(angles.pitch);
|
||||||
|
yaw = static_cast<T>(angles.yaw);
|
||||||
|
roll = static_cast<T>(angles.roll);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzEulerAngles<T>::SetZero()
|
||||||
|
{
|
||||||
|
Set(0.0, 0.0, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzEulerAngles<T>::ToQuaternion() const
|
||||||
|
{
|
||||||
|
NzQuaternion<T> Qx(pitch, NzVector3<T>(1.0, 0.0, 0.0));
|
||||||
|
NzQuaternion<T> Qy(yaw, NzVector3<T>(0.0, 1.0, 0.0));
|
||||||
|
NzQuaternion<T> Qz(roll, NzVector3<T>(0.0, 0.0, 1.0));
|
||||||
|
|
||||||
|
return Qx * Qy * Qz;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzString NzEulerAngles<T>::ToString() const
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
|
||||||
|
return ss << "EulerAngles(" << pitch << ", " << yaw << ", " << roll << ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T> NzEulerAngles<T>::operator+(const NzEulerAngles& angles) const
|
||||||
|
{
|
||||||
|
return NzEulerAngles(pitch + angles.pitch,
|
||||||
|
yaw + angles.yaw,
|
||||||
|
roll + angles.roll);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T> NzEulerAngles<T>::operator-(const NzEulerAngles& angles) const
|
||||||
|
{
|
||||||
|
return NzEulerAngles(pitch - angles.pitch,
|
||||||
|
yaw - angles.yaw,
|
||||||
|
roll - angles.roll);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T> NzEulerAngles<T>::operator+=(const NzEulerAngles& angles)
|
||||||
|
{
|
||||||
|
pitch += angles.pitch;
|
||||||
|
yaw += angles.yaw;
|
||||||
|
roll += angles.roll;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T> NzEulerAngles<T>::operator-=(const NzEulerAngles& angles)
|
||||||
|
{
|
||||||
|
pitch -= angles.pitch;
|
||||||
|
yaw -= angles.yaw;
|
||||||
|
roll -= angles.roll;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzEulerAngles<T>::operator==(const NzEulerAngles& angles) const
|
||||||
|
{
|
||||||
|
return NzNumberEquals(pitch, angles.pitch) &&
|
||||||
|
NzNumberEquals(yaw, angles.yaw) &&
|
||||||
|
NzNumberEquals(roll, angles.roll);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzEulerAngles<T>::operator!=(const NzEulerAngles& angles) const
|
||||||
|
{
|
||||||
|
return !operator==(angles);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::ostream& operator<<(std::ostream& out, const NzEulerAngles<T>& angles)
|
||||||
|
{
|
||||||
|
return out << angles.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
@ -0,0 +1,100 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_MATRIX4_HPP
|
||||||
|
#define NAZARA_MATRIX4_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
template<typename T> class NzEulerAngles;
|
||||||
|
template<typename T> class NzQuaternion;
|
||||||
|
template<typename T> class NzVector2;
|
||||||
|
template<typename T> class NzVector3;
|
||||||
|
template<typename T> class NzVector4;
|
||||||
|
|
||||||
|
template<typename T> class NzMatrix4
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzMatrix4();
|
||||||
|
NzMatrix4(T r11, T r12, T r13, T r14,
|
||||||
|
T r21, T r22, T r23, T r24,
|
||||||
|
T r31, T r32, T r33, T r34,
|
||||||
|
T r41, T r42, T r43, T r44);
|
||||||
|
NzMatrix4(T matrix[16]);
|
||||||
|
//NzMatrix4(const NzMatrix3<T>& mat);
|
||||||
|
template<typename U> explicit NzMatrix4(const NzMatrix4<U>& mat);
|
||||||
|
NzMatrix4(const NzMatrix4& mat) = default;
|
||||||
|
~NzMatrix4() = default;
|
||||||
|
|
||||||
|
T GetDeterminant() const;
|
||||||
|
NzMatrix4 GetInverse() const;
|
||||||
|
//NzMatrix3 GetRotationMatrix() const;
|
||||||
|
NzVector3<T> GetScale() const;
|
||||||
|
NzVector3<T> GetTranslation() const;
|
||||||
|
NzMatrix4 GetTransposed() const;
|
||||||
|
|
||||||
|
bool HasNegativeScale() const;
|
||||||
|
bool HasScale() const;
|
||||||
|
|
||||||
|
void Set(T r11, T r12, T r13, T r14,
|
||||||
|
T r21, T r22, T r23, T r24,
|
||||||
|
T r31, T r32, T r33, T r34,
|
||||||
|
T r41, T r42, T r43, T r44);
|
||||||
|
void Set(T matrix[16]);
|
||||||
|
//NzMatrix4(const NzMatrix3<T>& mat);
|
||||||
|
void Set(const NzMatrix4& mat);
|
||||||
|
template<typename U> void Set(const NzMatrix4<U>& mat);
|
||||||
|
void SetIdentity();
|
||||||
|
void SetLookAt(const NzVector3<T>& eye, const NzVector3<T>& center, const NzVector3<T>& up);
|
||||||
|
void SetPerspective(T angle, T ratio, T zNear, T zFar);
|
||||||
|
void SetRotation(const NzQuaternion<T>& rotation);
|
||||||
|
void SetScale(const NzVector3<T>& scale);
|
||||||
|
void SetTranslation(const NzVector3<T>& translation);
|
||||||
|
void SetZero();
|
||||||
|
|
||||||
|
NzString ToString() const;
|
||||||
|
|
||||||
|
NzVector2<T> Transform(const NzVector2<T>& vector, T z = 0.0, T w = 1.0) const;
|
||||||
|
NzVector3<T> Transform(const NzVector3<T>& vector, T w = 1.0) const;
|
||||||
|
NzVector4<T> Transform(const NzVector4<T>& vector) const;
|
||||||
|
|
||||||
|
NzMatrix4& Transpose();
|
||||||
|
|
||||||
|
operator T*();
|
||||||
|
operator const T*() const;
|
||||||
|
|
||||||
|
T& operator()(unsigned int x, unsigned int y);
|
||||||
|
const T& operator()(unsigned int x, unsigned int y) const;
|
||||||
|
|
||||||
|
NzMatrix4 operator*(const NzMatrix4& mat) const;
|
||||||
|
NzVector2<T> operator*(const NzVector2<T>& vector) const;
|
||||||
|
NzVector3<T> operator*(const NzVector3<T>& vector) const;
|
||||||
|
NzVector4<T> operator*(const NzVector4<T>& vector) const;
|
||||||
|
NzMatrix4 operator*(T scalar) const;
|
||||||
|
|
||||||
|
NzMatrix4& operator*=(const NzMatrix4& mat);
|
||||||
|
NzMatrix4& operator*=(T scalar);
|
||||||
|
|
||||||
|
static NzMatrix4 LookAt(const NzVector3<T>& eye, const NzVector3<T>& center, const NzVector3<T>& up);
|
||||||
|
static NzMatrix4 Perspective(T angle, T ratio, T zNear, T zFar);
|
||||||
|
static NzMatrix4 Rotate(const NzQuaternion<T>& rotation);
|
||||||
|
static NzMatrix4 Scale(const NzVector3<T>& scale);
|
||||||
|
static NzMatrix4 Translate(const NzVector3<T>& translation);
|
||||||
|
|
||||||
|
T m11, m12, m13, m14,
|
||||||
|
m21, m22, m23, m24,
|
||||||
|
m31, m32, m33, m34,
|
||||||
|
m41, m42, m43, m44;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> std::ostream& operator<<(std::ostream& out, const NzMatrix4<T>& mat);
|
||||||
|
|
||||||
|
typedef NzMatrix4<double> NzMatrix4d;
|
||||||
|
typedef NzMatrix4<float> NzMatrix4f;
|
||||||
|
|
||||||
|
#include <Nazara/Math/Matrix4.inl>
|
||||||
|
|
||||||
|
#endif // NAZARA_MATRIX4_HPP
|
||||||
|
|
@ -0,0 +1,576 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
|
#include <Nazara/Math/Basic.hpp>
|
||||||
|
#include <Nazara/Math/EulerAngles.hpp>
|
||||||
|
#include <Nazara/Math/Quaternion.hpp>
|
||||||
|
#include <Nazara/Math/Vector2.hpp>
|
||||||
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
|
#include <Nazara/Math/Vector4.hpp>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
|
#include <limits>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T>::NzMatrix4()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T>::NzMatrix4(T r11, T r12, T r13, T r14,
|
||||||
|
T r21, T r22, T r23, T r24,
|
||||||
|
T r31, T r32, T r33, T r34,
|
||||||
|
T r41, T r42, T r43, T r44)
|
||||||
|
{
|
||||||
|
Set(r11, r12, r13, r14,
|
||||||
|
r21, r22, r23, r24,
|
||||||
|
r31, r32, r33, r34,
|
||||||
|
r41, r42, r43, r44);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T>::NzMatrix4(T matrix[16])
|
||||||
|
{
|
||||||
|
Set(matrix);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
NzMatrix4<T>::NzMatrix4(const NzMatrix4<U>& mat)
|
||||||
|
{
|
||||||
|
Set(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzMatrix4<T>::GetDeterminant() const
|
||||||
|
{
|
||||||
|
T A = m22 * (m33 * m44 - m43 * m34) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24);
|
||||||
|
T B = m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14);
|
||||||
|
T C = m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14);
|
||||||
|
T D = m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14);
|
||||||
|
|
||||||
|
return m11 * A - m21 * B + m31 * C - m41 * D;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::GetInverse() const
|
||||||
|
{
|
||||||
|
NzMatrix4 mat;
|
||||||
|
T det = GetDeterminant();
|
||||||
|
|
||||||
|
if (det != 0.0)
|
||||||
|
{
|
||||||
|
mat.m11 = (m22 * (m33 * m44 - m34 * m43) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24)) / det;
|
||||||
|
mat.m12 = -(m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14)) / det;
|
||||||
|
mat.m13 = (m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14)) / det;
|
||||||
|
mat.m14 = -(m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14)) / det;
|
||||||
|
|
||||||
|
mat.m21 = -(m21 * (m33 * m44 - m34 * m43) - m23 * (m31 * m44 - m34 * m41) + m24 * (m31 * m43 - m33 * m41)) / det;
|
||||||
|
mat.m22 = (m11 * (m33 * m44 - m34 * m43) - m13 * (m31 * m44 - m34 * m41) + m14 * (m31 * m43 - m33 * m41)) / det;
|
||||||
|
mat.m23 = -(m11 * (m23 * m44 - m24 * m43) - m13 * (m21 * m44 - m24 * m41) + m14 * (m21 * m43 - m23 * m41)) / det;
|
||||||
|
mat.m24 = (m11 * (m23 * m34 - m24 * m33) - m13 * (m21 * m34 - m24 * m31) + m14 * (m21 * m33 - m23 * m31)) / det;
|
||||||
|
|
||||||
|
mat.m31 = (m21 * (m32 * m44 - m34 * m42) - m22 * (m31 * m44 - m34 * m41) + m24 * (m31 * m42 - m32 * m41)) / det;
|
||||||
|
mat.m32 = -(m11 * (m32 * m44 - m34 * m42) - m12 * (m31 * m44 - m34 * m41) + m14 * (m31 * m42 - m32 * m41)) / det;
|
||||||
|
mat.m33 = (m11 * (m22 * m44 - m24 * m42) - m12 * (m21 * m44 - m24 * m41) + m14 * (m21 * m42 - m22 * m41)) / det;
|
||||||
|
mat.m34 = -(m11 * (m22 * m34 - m24 * m32) - m12 * (m21 * m34 - m24 * m31) + m14 * (m21 * m32 - m22 * m31)) / det;
|
||||||
|
|
||||||
|
mat.m41 = -(m21 * (m32 * m43 - m33 * m42) - m22 * (m31 * m43 - m33 * m41) + m23 * (m31 * m42 - m32 * m41)) / det;
|
||||||
|
mat.m42 = (m11 * (m32 * m43 - m33 * m42) - m12 * (m31 * m43 - m33 * m41) + m13 * (m31 * m42 - m32 * m41)) / det;
|
||||||
|
mat.m43 = -(m11 * (m22 * m43 - m23 * m42) - m12 * (m21 * m43 - m23 * m41) + m13 * (m21 * m42 - m22 * m41)) / det;
|
||||||
|
mat.m44 = (m11 * (m22 * m33 - m23 * m32) - m12 * (m21 * m33 - m23 * m31) + m13 * (m21 * m32 - m22 * m31)) / det;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzMatrix4<T>::GetScale() const
|
||||||
|
{
|
||||||
|
return NzVector3<T>(std::sqrt(m11 * m11 + m21 * m21 + m31 * m31),
|
||||||
|
std::sqrt(m12 * m12 + m22 * m22 + m32 * m32),
|
||||||
|
std::sqrt(m13 * m13 + m23 * m23 + m33 * m33));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzMatrix4<T>::GetTranslation() const
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_MATRIX_COLUMN_MAJOR
|
||||||
|
return NzVector3<T>(m41, m42, m43);
|
||||||
|
#else
|
||||||
|
return NzVector3<T>(m14, m24, m34);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::GetTransposed() const
|
||||||
|
{
|
||||||
|
return NzMatrix4(m11, m21, m31, m41,
|
||||||
|
m12, m22, m32, m42,
|
||||||
|
m13, m23, m33, m43,
|
||||||
|
m14, m24, m34, m44);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzMatrix4<T>::HasNegativeScale() const
|
||||||
|
{
|
||||||
|
return GetDeterminant() < 0.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzMatrix4<T>::HasScale() const
|
||||||
|
{
|
||||||
|
T t = m11 * m11 + m21 * m21 + m31 * m31;
|
||||||
|
if (1.0 - t > std::numeric_limits<T>::epsilon())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
t = m12 * m12 + m22 * m22 + m32 * m32;
|
||||||
|
if (1.0 - t > std::numeric_limits<T>::epsilon())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
t = m13 * m13 + m23 * m23 + m33 * m33;
|
||||||
|
if (1.0 - t > std::numeric_limits<T>::epsilon())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzMatrix4<T>::Set(T r11, T r12, T r13, T r14,
|
||||||
|
T r21, T r22, T r23, T r24,
|
||||||
|
T r31, T r32, T r33, T r34,
|
||||||
|
T r41, T r42, T r43, T r44)
|
||||||
|
{
|
||||||
|
m11 = r11;
|
||||||
|
m12 = r12;
|
||||||
|
m13 = r13;
|
||||||
|
m14 = r14;
|
||||||
|
m21 = r21;
|
||||||
|
m22 = r22;
|
||||||
|
m23 = r23;
|
||||||
|
m24 = r24;
|
||||||
|
m31 = r31;
|
||||||
|
m32 = r32;
|
||||||
|
m33 = r33;
|
||||||
|
m34 = r34;
|
||||||
|
m41 = r41;
|
||||||
|
m42 = r42;
|
||||||
|
m43 = r43;
|
||||||
|
m44 = r44;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T> void NzMatrix4<T>::Set(T matrix[16])
|
||||||
|
{
|
||||||
|
// Ici nous sommes certains de la continuité des éléments en mémoire
|
||||||
|
std::memcpy(&m41, matrix, 16*sizeof(T));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T> void NzMatrix4<T>::Set(const NzMatrix4& mat)
|
||||||
|
{
|
||||||
|
// Pareil
|
||||||
|
std::memcpy(&m41, &mat.m41, 16*sizeof(T));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
void NzMatrix4<T>::Set(const NzMatrix4<U>& mat)
|
||||||
|
{
|
||||||
|
m11 = static_cast<T>(mat.m11);
|
||||||
|
m12 = static_cast<T>(mat.m12);
|
||||||
|
m13 = static_cast<T>(mat.m13);
|
||||||
|
m14 = static_cast<T>(mat.m14);
|
||||||
|
m21 = static_cast<T>(mat.m21);
|
||||||
|
m22 = static_cast<T>(mat.m22);
|
||||||
|
m23 = static_cast<T>(mat.m23);
|
||||||
|
m24 = static_cast<T>(mat.m24);
|
||||||
|
m31 = static_cast<T>(mat.m31);
|
||||||
|
m32 = static_cast<T>(mat.m32);
|
||||||
|
m33 = static_cast<T>(mat.m33);
|
||||||
|
m34 = static_cast<T>(mat.m34);
|
||||||
|
m41 = static_cast<T>(mat.m41);
|
||||||
|
m42 = static_cast<T>(mat.m42);
|
||||||
|
m43 = static_cast<T>(mat.m43);
|
||||||
|
m44 = static_cast<T>(mat.m44);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzMatrix4<T>::SetIdentity()
|
||||||
|
{
|
||||||
|
Set(1.0, 0.0, 0.0, 0.0,
|
||||||
|
0.0, 1.0, 0.0, 0.0,
|
||||||
|
0.0, 0.0, 1.0, 0.0,
|
||||||
|
0.0, 0.0, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzMatrix4<T>::SetLookAt(const NzVector3<T>& eye, const NzVector3<T>& center, const NzVector3<T>& up)
|
||||||
|
{
|
||||||
|
NzVector3<T> f = center - eye;
|
||||||
|
f.Normalize();
|
||||||
|
|
||||||
|
NzVector3<T> u = up;
|
||||||
|
u.Normalize();
|
||||||
|
|
||||||
|
NzVector3<T> s = f.CrossProduct(u);
|
||||||
|
s.Normalize();
|
||||||
|
|
||||||
|
u = s.CrossProduct(f);
|
||||||
|
|
||||||
|
Set(s.x, u.x, -f.x, 0.0,
|
||||||
|
s.y, u.y, -f.y, 0.0,
|
||||||
|
s.z, u.z, -f.z, 0.0,
|
||||||
|
0.0, 0.0, 0.0, 1.0);
|
||||||
|
|
||||||
|
operator*=(Translate(-eye));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzMatrix4<T>::SetPerspective(T angle, T ratio, T zNear, T zFar)
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_ANGLE_RADIAN
|
||||||
|
angle /= 2;
|
||||||
|
#else
|
||||||
|
angle = NzDegreeToRadian(angle/2);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
T f = 1 / std::tan(angle);
|
||||||
|
|
||||||
|
#if NAZARA_MATH_MATRIX_COLUMN_MAJOR
|
||||||
|
Set(f / ratio, 0.0, 0.0, 0.0,
|
||||||
|
0.0, f, 0.0, 0.0,
|
||||||
|
0.0, 0.0, (zNear + zFar) / (zNear - zFar), -1.0,
|
||||||
|
0.0, 0.0, (2 * zNear * zFar) / (zNear - zFar), 1.0);
|
||||||
|
#else
|
||||||
|
Set(f / ratio, 0.0, 0.0, 0.0,
|
||||||
|
0.0, f, 0.0, 0.0,
|
||||||
|
0.0, 0.0, (zNear + zFar) / (zNear - zFar), (2 * zNear * zFar) / (zNear - zFar),
|
||||||
|
0.0, 0.0, -1.0, 1.0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzMatrix4<T>::SetRotation(const NzQuaternion<T>& rotation)
|
||||||
|
{
|
||||||
|
// http://www.flipcode.com/documents/matrfaq.html#Q54
|
||||||
|
T xx = rotation.x * rotation.x;
|
||||||
|
T xy = rotation.x * rotation.y;
|
||||||
|
T xz = rotation.x * rotation.z;
|
||||||
|
T xw = rotation.x * rotation.w;
|
||||||
|
|
||||||
|
T yy = rotation.y * rotation.y;
|
||||||
|
T yz = rotation.y * rotation.z;
|
||||||
|
T yw = rotation.y * rotation.w;
|
||||||
|
|
||||||
|
T zz = rotation.z * rotation.z;
|
||||||
|
T zw = rotation.z * rotation.w;
|
||||||
|
|
||||||
|
Set(1.0 - 2.0*(yy+zz), 2.0*(xy-zw), 2.0*(xz+yw), 0.0,
|
||||||
|
2.0*(xz+zw), 1.0 - 2.0*(xx+zz), 2.0*(yz-xw), 0.0,
|
||||||
|
2.0*(xz-yw), 2.0*(yz+xw), 1.0 - 2.0*(xx+yy), 0.0,
|
||||||
|
0.0, 0.0, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzMatrix4<T>::SetScale(const NzVector3<T>& vector)
|
||||||
|
{
|
||||||
|
Set(vector.x, 0.0, 0.0, 0.0,
|
||||||
|
0.0, vector.y, 0.0, 0.0,
|
||||||
|
0.0, 0.0, vector.z, 0.0,
|
||||||
|
0.0, 0.0, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzMatrix4<T>::SetTranslation(const NzVector3<T>& translation)
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_MATRIX_COLUMN_MAJOR
|
||||||
|
Set(1.0, 0.0, 0.0, 0.0,
|
||||||
|
0.0, 1.0, 0.0, 0.0,
|
||||||
|
0.0, 0.0, 1.0, 0.0,
|
||||||
|
translation.x, translation.y, translation.z, 1.0);
|
||||||
|
#else
|
||||||
|
Set(1.0, 0.0, 0.0, translation.x,
|
||||||
|
0.0, 1.0, 0.0, translation.y,
|
||||||
|
0.0, 0.0, 1.0, translation.z,
|
||||||
|
0.0, 0.0, 0.0, 1.0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzMatrix4<T>::SetZero()
|
||||||
|
{
|
||||||
|
Set(0.0, 0.0, 0.0, 0.0,
|
||||||
|
0.0, 0.0, 0.0, 0.0,
|
||||||
|
0.0, 0.0, 0.0, 0.0,
|
||||||
|
0.0, 0.0, 0.0, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzString NzMatrix4<T>::ToString() const
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
|
||||||
|
return ss << "Matrix4(" << m11 << ", " << m12 << ", " << m13 << ", " << m14 << ",\n"
|
||||||
|
<< " " << m21 << ", " << m22 << ", " << m23 << ", " << m24 << ",\n"
|
||||||
|
<< " " << m31 << ", " << m32 << ", " << m33 << ", " << m34 << ",\n"
|
||||||
|
<< " " << m41 << ", " << m42 << ", " << m43 << ", " << m44 << ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzMatrix4<T>::Transform(const NzVector2<T>& vector, T z, T w) const
|
||||||
|
{
|
||||||
|
return NzVector2<T>(m11 * vector.x + m12 * vector.y + m13 * z + m14 * w,
|
||||||
|
m21 * vector.x + m22 * vector.y + m23 * z + m24 * w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzMatrix4<T>::Transform(const NzVector3<T>& vector, T w) const
|
||||||
|
{
|
||||||
|
return NzVector3<T>(m11 * vector.x + m12 * vector.y + m13 * vector.z + m14 * w,
|
||||||
|
m21 * vector.x + m22 * vector.y + m23 * vector.z + m24 * w,
|
||||||
|
m31 * vector.x + m32 * vector.y + m33 * vector.z + m34 * w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzMatrix4<T>::Transform(const NzVector4<T>& vector) const
|
||||||
|
{
|
||||||
|
return NzVector4<T>(m11 * vector.x + m12 * vector.y + m13 * vector.z + m14 * vector.w,
|
||||||
|
m21 * vector.x + m22 * vector.y + m23 * vector.z + m24 * vector.w,
|
||||||
|
m31 * vector.x + m32 * vector.y + m33 * vector.z + m34 * vector.w,
|
||||||
|
m41 * vector.x + m42 * vector.y + m43 * vector.z + m44 * vector.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T>& NzMatrix4<T>::Transpose()
|
||||||
|
{
|
||||||
|
std::swap(m12, m21);
|
||||||
|
std::swap(m13, m31);
|
||||||
|
std::swap(m14, m41);
|
||||||
|
std::swap(m23, m32);
|
||||||
|
std::swap(m24, m42);
|
||||||
|
std::swap(m34, m43);
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T>::operator T*()
|
||||||
|
{
|
||||||
|
return &m11;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T>::operator const T*() const
|
||||||
|
{
|
||||||
|
return &m11;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T& NzMatrix4<T>::operator()(unsigned int x, unsigned int y)
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_SAFE
|
||||||
|
if (x > 3 || y > 3)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Index out of range: (" << x << ", " << y << ") > (3,3)";
|
||||||
|
|
||||||
|
throw std::out_of_range(ss.ToString());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (&m11)[x*4+y];
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
const T& NzMatrix4<T>::operator()(unsigned int x, unsigned int y) const
|
||||||
|
{
|
||||||
|
#if NAZARA_MATH_SAFE
|
||||||
|
if (x > 3 || y > 3)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Index out of range: (" << x << ", " << y << ") > (3,3)";
|
||||||
|
|
||||||
|
throw std::out_of_range(ss.ToString());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (&m11)[x*4+y];
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::operator*(const NzMatrix4& mat) const
|
||||||
|
{
|
||||||
|
NzMatrix4 matrix;
|
||||||
|
for(int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
for(int j = 0; j < 4; j++)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < 4; i++)
|
||||||
|
matrix(j, k) += (*this)(j, i) * mat(i, k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return matrix;
|
||||||
|
/*return NzMatrix4(m11 * mat.m11 + m21 * mat.m12 + m31 * mat.m13 + m41 * mat.m14,
|
||||||
|
m12 * mat.m11 + m22 * mat.m12 + m32 * mat.m13 + m42 * mat.m14,
|
||||||
|
m13 * mat.m11 + m23 * mat.m12 + m33 * mat.m13 + m43 * mat.m14,
|
||||||
|
m14 * mat.m11 + m24 * mat.m12 + m34 * mat.m13 + m44 * mat.m14,
|
||||||
|
m11 * mat.m21 + m21 * mat.m22 + m31 * mat.m23 + m41 * mat.m24,
|
||||||
|
m12 * mat.m21 + m22 * mat.m22 + m32 * mat.m23 + m42 * mat.m24,
|
||||||
|
m13 * mat.m21 + m23 * mat.m22 + m33 * mat.m23 + m43 * mat.m24,
|
||||||
|
m14 * mat.m21 + m24 * mat.m22 + m34 * mat.m23 + m44 * mat.m24,
|
||||||
|
m11 * mat.m31 + m21 * mat.m32 + m31 * mat.m33 + m41 * mat.m34,
|
||||||
|
m12 * mat.m31 + m22 * mat.m32 + m32 * mat.m33 + m42 * mat.m34,
|
||||||
|
m13 * mat.m31 + m23 * mat.m32 + m33 * mat.m33 + m43 * mat.m34,
|
||||||
|
m14 * mat.m31 + m24 * mat.m32 + m34 * mat.m33 + m44 * mat.m34,
|
||||||
|
m11 * mat.m41 + m21 * mat.m42 + m31 * mat.m43 + m41 * mat.m44,
|
||||||
|
m12 * mat.m41 + m22 * mat.m42 + m32 * mat.m43 + m42 * mat.m44,
|
||||||
|
m13 * mat.m41 + m23 * mat.m42 + m33 * mat.m43 + m43 * mat.m44,
|
||||||
|
m14 * mat.m41 + m24 * mat.m42 + m34 * mat.m43 + m44 * mat.m44);*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzMatrix4<T>::operator*(const NzVector2<T>& vector) const
|
||||||
|
{
|
||||||
|
return Transform(vector);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzMatrix4<T>::operator*(const NzVector3<T>& vector) const
|
||||||
|
{
|
||||||
|
return Transform(vector);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzMatrix4<T>::operator*(const NzVector4<T>& vector) const
|
||||||
|
{
|
||||||
|
return Transform(vector);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::operator*(T scalar) const
|
||||||
|
{
|
||||||
|
return NzMatrix4(m11 * scalar, m12 * scalar, m13 * scalar, m14 * scalar,
|
||||||
|
m21 * scalar, m22 * scalar, m23 * scalar, m24 * scalar,
|
||||||
|
m31 * scalar, m32 * scalar, m33 * scalar, m34 * scalar,
|
||||||
|
m41 * scalar, m42 * scalar, m43 * scalar, m44 * scalar);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T>& NzMatrix4<T>::operator*=(const NzMatrix4& mat)
|
||||||
|
{
|
||||||
|
T r11 = m11 * mat.m11 + m21 * mat.m12 + m31 * mat.m13 + m41 * mat.m14;
|
||||||
|
T r12 = m12 * mat.m11 + m22 * mat.m12 + m32 * mat.m13 + m42 * mat.m14;
|
||||||
|
T r13 = m13 * mat.m11 + m23 * mat.m12 + m33 * mat.m13 + m43 * mat.m14;
|
||||||
|
T r14 = m14 * mat.m11 + m24 * mat.m12 + m34 * mat.m13 + m44 * mat.m14;
|
||||||
|
T r21 = m11 * mat.m21 + m21 * mat.m22 + m31 * mat.m23 + m41 * mat.m24;
|
||||||
|
T r22 = m12 * mat.m21 + m22 * mat.m22 + m32 * mat.m23 + m42 * mat.m24;
|
||||||
|
T r23 = m13 * mat.m21 + m23 * mat.m22 + m33 * mat.m23 + m43 * mat.m24;
|
||||||
|
T r24 = m14 * mat.m21 + m24 * mat.m22 + m34 * mat.m23 + m44 * mat.m24;
|
||||||
|
T r31 = m11 * mat.m31 + m21 * mat.m32 + m31 * mat.m33 + m41 * mat.m34;
|
||||||
|
T r32 = m12 * mat.m31 + m22 * mat.m32 + m32 * mat.m33 + m42 * mat.m34;
|
||||||
|
T r33 = m13 * mat.m31 + m23 * mat.m32 + m33 * mat.m33 + m43 * mat.m34;
|
||||||
|
T r34 = m14 * mat.m31 + m24 * mat.m32 + m34 * mat.m33 + m44 * mat.m34;
|
||||||
|
T r41 = m11 * mat.m41 + m21 * mat.m42 + m31 * mat.m43 + m41 * mat.m44;
|
||||||
|
T r42 = m12 * mat.m41 + m22 * mat.m42 + m32 * mat.m43 + m42 * mat.m44;
|
||||||
|
T r43 = m13 * mat.m41 + m23 * mat.m42 + m33 * mat.m43 + m43 * mat.m44;
|
||||||
|
|
||||||
|
m44 = m14 * mat.m41 + m24 * mat.m42 + m34 * mat.m43 + m44 * mat.m44;
|
||||||
|
m43 = r43;
|
||||||
|
m42 = r42;
|
||||||
|
m41 = r41;
|
||||||
|
m34 = r34;
|
||||||
|
m33 = r33;
|
||||||
|
m32 = r32;
|
||||||
|
m31 = r31;
|
||||||
|
m24 = r24;
|
||||||
|
m23 = r23;
|
||||||
|
m22 = r22;
|
||||||
|
m21 = r21;
|
||||||
|
m14 = r14;
|
||||||
|
m13 = r13;
|
||||||
|
m12 = r12;
|
||||||
|
m11 = r11;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T>& NzMatrix4<T>::operator*=(T scalar)
|
||||||
|
{
|
||||||
|
m11 *= scalar;
|
||||||
|
m12 *= scalar;
|
||||||
|
m13 *= scalar;
|
||||||
|
m14 *= scalar;
|
||||||
|
m21 *= scalar;
|
||||||
|
m22 *= scalar;
|
||||||
|
m23 *= scalar;
|
||||||
|
m24 *= scalar;
|
||||||
|
m31 *= scalar;
|
||||||
|
m32 *= scalar;
|
||||||
|
m33 *= scalar;
|
||||||
|
m34 *= scalar;
|
||||||
|
m41 *= scalar;
|
||||||
|
m42 *= scalar;
|
||||||
|
m43 *= scalar;
|
||||||
|
m44 *= scalar;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::LookAt(const NzVector3<T>& eye, const NzVector3<T>& center, const NzVector3<T>& up)
|
||||||
|
{
|
||||||
|
NzMatrix4 mat;
|
||||||
|
mat.SetLookAt(eye, center, up);
|
||||||
|
|
||||||
|
return mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::Perspective(T angle, T ratio, T zNear, T zFar)
|
||||||
|
{
|
||||||
|
NzMatrix4 mat;
|
||||||
|
mat.SetPerspective(angle, ratio, zNear, zFar);
|
||||||
|
|
||||||
|
return mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::Rotate(const NzQuaternion<T>& rotation)
|
||||||
|
{
|
||||||
|
NzMatrix4 mat;
|
||||||
|
mat.SetRotation(rotation);
|
||||||
|
|
||||||
|
return mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::Scale(const NzVector3<T>& scale)
|
||||||
|
{
|
||||||
|
NzMatrix4 mat;
|
||||||
|
mat.SetScale(scale);
|
||||||
|
|
||||||
|
return mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzMatrix4<T> NzMatrix4<T>::Translate(const NzVector3<T>& translation)
|
||||||
|
{
|
||||||
|
NzMatrix4 mat;
|
||||||
|
mat.SetTranslation(translation);
|
||||||
|
|
||||||
|
return mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::ostream& operator<<(std::ostream& out, const NzMatrix4<T>& mat)
|
||||||
|
{
|
||||||
|
return out << mat.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
// Copyright (C) 2012 Rémi Begues
|
||||||
|
// Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_QUATERNION_HPP
|
||||||
|
#define NAZARA_QUATERNION_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
template<typename T> class NzEulerAngles;
|
||||||
|
template<typename T> class NzVector3;
|
||||||
|
|
||||||
|
template<typename T> class NzQuaternion
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzQuaternion();
|
||||||
|
NzQuaternion(T W, T X, T Y, T Z);
|
||||||
|
NzQuaternion(T quat[4]);
|
||||||
|
NzQuaternion(T angle, const NzVector3<T>& axis);
|
||||||
|
NzQuaternion(const NzEulerAngles<T>& angles);
|
||||||
|
//NzQuaternion(const NzMatrix3<T>& mat);
|
||||||
|
template<typename U> explicit NzQuaternion(const NzQuaternion<U>& quat);
|
||||||
|
NzQuaternion(const NzQuaternion& quat) = default;
|
||||||
|
~NzQuaternion() = default;
|
||||||
|
|
||||||
|
NzQuaternion GetConjugate() const;
|
||||||
|
NzQuaternion GetNormalized() const;
|
||||||
|
|
||||||
|
double Magnitude() const;
|
||||||
|
double Normalize();
|
||||||
|
T SquaredMagnitude() const;
|
||||||
|
|
||||||
|
void Set(T W, T X, T Y, T Z);
|
||||||
|
void Set(T quat[4]);
|
||||||
|
void Set(T angle, const NzVector3<T>& normalizedAxis);
|
||||||
|
void Set(const NzEulerAngles<T>& angles);
|
||||||
|
//void Set(const NzMatrix3<T>& mat);
|
||||||
|
void Set(const NzQuaternion& quat);
|
||||||
|
template<typename U> void Set(const NzQuaternion<U>& quat);
|
||||||
|
void SetIdentity();
|
||||||
|
void SetZero();
|
||||||
|
|
||||||
|
NzEulerAngles<T> ToEulerAngles() const;
|
||||||
|
//NzMatrix3<T> ToRotationMatrix() const;
|
||||||
|
NzString ToString() const;
|
||||||
|
|
||||||
|
NzQuaternion operator+(const NzQuaternion& quat) const;
|
||||||
|
NzQuaternion operator*(const NzQuaternion& quat) const;
|
||||||
|
NzVector3<T> operator*(const NzVector3<T>& vec) const;
|
||||||
|
NzQuaternion operator*(T scale) const;
|
||||||
|
NzQuaternion operator/(const NzQuaternion& quat) const;
|
||||||
|
|
||||||
|
NzQuaternion operator+=(const NzQuaternion& quat);
|
||||||
|
NzQuaternion operator*=(const NzQuaternion& quat);
|
||||||
|
NzQuaternion operator*=(T scale);
|
||||||
|
NzQuaternion operator/=(const NzQuaternion& quat);
|
||||||
|
|
||||||
|
bool operator==(const NzQuaternion& quat) const;
|
||||||
|
bool operator!=(const NzQuaternion& quat) const;
|
||||||
|
bool operator<(const NzQuaternion& quat) const;
|
||||||
|
bool operator<=(const NzQuaternion& quat) const;
|
||||||
|
bool operator>(const NzQuaternion& quat) const;
|
||||||
|
bool operator>=(const NzQuaternion& quat) const;
|
||||||
|
|
||||||
|
T w, x, y, z;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> std::ostream& operator<<(std::ostream& out, const NzQuaternion<T>& quat);
|
||||||
|
|
||||||
|
typedef NzQuaternion<double> NzQuaterniond;
|
||||||
|
typedef NzQuaternion<float> NzQuaternionf;
|
||||||
|
|
||||||
|
#include <Nazara/Math/Quaternion.inl>
|
||||||
|
|
||||||
|
#endif // NAZARA_QUATERNION_HPP
|
||||||
|
|
@ -0,0 +1,328 @@
|
||||||
|
// Copyright (C) 2012 Rémi Begues
|
||||||
|
// Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
|
#include <Nazara/Math/Basic.hpp>
|
||||||
|
#include <Nazara/Math/EulerAngles.hpp>
|
||||||
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T>::NzQuaternion()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T>::NzQuaternion(T W, T X, T Y, T Z)
|
||||||
|
{
|
||||||
|
Set(W, X, Y, Z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T>::NzQuaternion(T quat[4])
|
||||||
|
{
|
||||||
|
Set(quat);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T>::NzQuaternion(T angle, const NzVector3<T>& axis)
|
||||||
|
{
|
||||||
|
Set(angle, axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T>::NzQuaternion(const NzEulerAngles<T>& angles)
|
||||||
|
{
|
||||||
|
Set(angles);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T>::NzQuaternion(const NzMatrix3<T>& mat)
|
||||||
|
{
|
||||||
|
Set(mat);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
NzQuaternion<T>::NzQuaternion(const NzQuaternion<U>& quat)
|
||||||
|
{
|
||||||
|
Set(quat);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::GetConjugate() const
|
||||||
|
{
|
||||||
|
return NzQuaternion(w, -x, -y, -z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::GetNormalized() const
|
||||||
|
{
|
||||||
|
NzQuaternion<T> quat(*this);
|
||||||
|
quat.Normalize();
|
||||||
|
|
||||||
|
return quat;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
double NzQuaternion<T>::Magnitude() const
|
||||||
|
{
|
||||||
|
return std::sqrt(SquaredMagnitude());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
double NzQuaternion<T>::Normalize()
|
||||||
|
{
|
||||||
|
double length = Magnitude();
|
||||||
|
|
||||||
|
if (length != 0.0)
|
||||||
|
{
|
||||||
|
w /= length;
|
||||||
|
x /= length;
|
||||||
|
y /= length;
|
||||||
|
z /= length;
|
||||||
|
}
|
||||||
|
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzQuaternion<T>::SquaredMagnitude() const
|
||||||
|
{
|
||||||
|
return w * w + x * x + y * y + z * z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzQuaternion<T>::Set(T W, T X, T Y, T Z)
|
||||||
|
{
|
||||||
|
w = W;
|
||||||
|
x = X;
|
||||||
|
y = Y;
|
||||||
|
z = Z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzQuaternion<T>::Set(T quat[4])
|
||||||
|
{
|
||||||
|
w = quat[0];
|
||||||
|
x = quat[1];
|
||||||
|
y = quat[2];
|
||||||
|
z = quat[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzQuaternion<T>::Set(T angle, const NzVector3<T>& normalizedAxis)
|
||||||
|
{
|
||||||
|
#if !NAZARA_MATH_ANGLE_RADIAN
|
||||||
|
angle = NzDegreeToRadian(angle);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
angle /= 2;
|
||||||
|
|
||||||
|
auto sinAngle = std::sin(angle);
|
||||||
|
|
||||||
|
w = std::cos(angle);
|
||||||
|
x = normalizedAxis.x * sinAngle;
|
||||||
|
y = normalizedAxis.y * sinAngle;
|
||||||
|
z = normalizedAxis.z * sinAngle;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzQuaternion<T>::Set(const NzEulerAngles<T>& angles)
|
||||||
|
{
|
||||||
|
Set(angles.ToQuaternion());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
void NzQuaternion<T>::Set(const NzQuaternion<U>& quat)
|
||||||
|
{
|
||||||
|
w = static_cast<T>(quat.w);
|
||||||
|
x = static_cast<T>(quat.x);
|
||||||
|
y = static_cast<T>(quat.y);
|
||||||
|
z = static_cast<T>(quat.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzQuaternion<T>::Set(const NzQuaternion& quat)
|
||||||
|
{
|
||||||
|
w = quat.w;
|
||||||
|
x = quat.x;
|
||||||
|
y = quat.y;
|
||||||
|
z = quat.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzQuaternion<T>::SetIdentity()
|
||||||
|
{
|
||||||
|
Set(1.0, 0.0, 0.0, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzQuaternion<T>::SetZero()
|
||||||
|
{
|
||||||
|
Set(0.0, 0.0, 0.0, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzEulerAngles<T> NzQuaternion<T>::ToEulerAngles() const
|
||||||
|
{
|
||||||
|
T test = x*y + z*w;
|
||||||
|
if (test > 0.499)
|
||||||
|
// singularity at north pole
|
||||||
|
return NzEulerAngles<T>(NzDegrees(90.0), NzRadians(2.0 * std::atan2(x, w)), 0.0);
|
||||||
|
|
||||||
|
if (test < -0.499)
|
||||||
|
return NzEulerAngles<T>(NzDegrees(-90.0), NzRadians(-2.0 * std::atan2(x, w)), 0.0);
|
||||||
|
|
||||||
|
T xx = x*x;
|
||||||
|
T yy = y*y;
|
||||||
|
T zz = z*z;
|
||||||
|
|
||||||
|
return NzEulerAngles<T>(NzRadians(std::atan2(2.0*x*w - 2.0*y*z, 1.0 - 2.0*xx - 2.0*zz)),
|
||||||
|
NzRadians(std::atan2(2.0*y*w - 2.0*x*z, 1.f - 2.0*yy - 2.0*zz)),
|
||||||
|
NzRadians(std::asin(2.0*test)));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzString NzQuaternion<T>::ToString() const
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
|
||||||
|
return ss << "Quaternion(" << w << " | " << x << ", " << y << ", " << z << ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::operator+(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return NzQuaternion(w + quat.w,
|
||||||
|
x + quat.x,
|
||||||
|
y + quat.y,
|
||||||
|
z + quat.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::operator*(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return NzQuaternion(w * quat.w - x * quat.x - y * quat.y - z * quat.z,
|
||||||
|
w * quat.x + x * quat.w + y * quat.z - z * quat.y,
|
||||||
|
w * quat.y + y * quat.w + z * quat.x - x * quat.z,
|
||||||
|
w * quat.z + z * quat.w + x * quat.y - y * quat.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzQuaternion<T>::operator*(const NzVector3<T>& vec) const
|
||||||
|
{
|
||||||
|
NzVector3<T> uv, uuv;
|
||||||
|
NzVector3<T> qvec(x, y, z);
|
||||||
|
uv = qvec.CrossProduct(vec);
|
||||||
|
uuv = qvec.CrossProduct(uv);
|
||||||
|
uv *= 2.0 * w;
|
||||||
|
uuv *= 2.0;
|
||||||
|
|
||||||
|
return vec + uv + uuv;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::operator*(T scale) const
|
||||||
|
{
|
||||||
|
return NzQuaternion(w * scale,
|
||||||
|
x * scale,
|
||||||
|
y * scale,
|
||||||
|
z * scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::operator/(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return GetConjugate(quat) * (*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::operator+=(const NzQuaternion& quat)
|
||||||
|
{
|
||||||
|
w += quat.w;
|
||||||
|
x += quat.x;
|
||||||
|
y += quat.y;
|
||||||
|
z += quat.z;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::operator*=(const NzQuaternion& quat)
|
||||||
|
{
|
||||||
|
NzQuaternion q(*this);
|
||||||
|
operator=(q * quat);
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::operator*=(T scale)
|
||||||
|
{
|
||||||
|
w *= scale;
|
||||||
|
x *= scale;
|
||||||
|
y *= scale;
|
||||||
|
z *= scale;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzQuaternion<T> NzQuaternion<T>::operator/=(const NzQuaternion& quat)
|
||||||
|
{
|
||||||
|
NzQuaternion q(*this);
|
||||||
|
operator=(q / quat);
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzQuaternion<T>::operator==(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return NzNumberEquals(w, quat.w) &&
|
||||||
|
NzNumberEquals(x, quat.x) &&
|
||||||
|
NzNumberEquals(y, quat.y) &&
|
||||||
|
NzNumberEquals(z, quat.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzQuaternion<T>::operator!=(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return !operator==(quat);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzQuaternion<T>::operator<(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return w < quat.w && x < quat.x && y < quat.y && z < quat.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzQuaternion<T>::operator<=(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return operator<(quat) || operator==(quat);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzQuaternion<T>::operator>(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return !operator<=(quat);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzQuaternion<T>::operator>=(const NzQuaternion& quat) const
|
||||||
|
{
|
||||||
|
return !operator<(quat);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::ostream& operator<<(std::ostream& out, const NzQuaternion<T>& quat)
|
||||||
|
{
|
||||||
|
return out << quat.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_VECTOR2_HPP
|
||||||
|
#define NAZARA_VECTOR2_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
template<typename T> class NzVector2
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzVector2();
|
||||||
|
NzVector2(T X, T Y);
|
||||||
|
explicit NzVector2(T scale);
|
||||||
|
NzVector2(T vec[2]);
|
||||||
|
template<typename U> explicit NzVector2(const NzVector2<U>& vec);
|
||||||
|
NzVector2(const NzVector2& vec) = default;
|
||||||
|
~NzVector2() = default;
|
||||||
|
|
||||||
|
T AbsDotProduct(const NzVector2& vec) const;
|
||||||
|
double Distance(const NzVector2& vec) const;
|
||||||
|
T DotProduct(const NzVector2& vec) const;
|
||||||
|
NzVector2 GetNormal() const;
|
||||||
|
void MakeCeil(const NzVector2& vec);
|
||||||
|
void MakeFloor(const NzVector2& vec);
|
||||||
|
double Length() const;
|
||||||
|
double Normalize();
|
||||||
|
T SquaredDistance(const NzVector2& vec) const;
|
||||||
|
T SquaredLength() const;
|
||||||
|
|
||||||
|
NzString ToString() const;
|
||||||
|
|
||||||
|
operator NzString() const;
|
||||||
|
|
||||||
|
T& operator[](unsigned int i);
|
||||||
|
T operator[](unsigned int i) const;
|
||||||
|
|
||||||
|
const NzVector2& operator+() const;
|
||||||
|
NzVector2 operator-() const;
|
||||||
|
|
||||||
|
NzVector2 operator+(const NzVector2& vec) const;
|
||||||
|
NzVector2 operator-(const NzVector2& vec) const;
|
||||||
|
NzVector2 operator*(const NzVector2& vec) const;
|
||||||
|
NzVector2 operator*(T scale) const;
|
||||||
|
NzVector2 operator/(const NzVector2& vec) const;
|
||||||
|
NzVector2 operator/(T scale) const;
|
||||||
|
|
||||||
|
NzVector2& operator+=(const NzVector2& vec);
|
||||||
|
NzVector2& operator-=(const NzVector2& vec);
|
||||||
|
NzVector2& operator*=(const NzVector2& vec);
|
||||||
|
NzVector2& operator*=(T scale);
|
||||||
|
NzVector2& operator/=(const NzVector2& vec);
|
||||||
|
NzVector2& operator/=(T scale);
|
||||||
|
|
||||||
|
bool operator==(const NzVector2& vec) const;
|
||||||
|
bool operator!=(const NzVector2& vec) const;
|
||||||
|
bool operator<(const NzVector2& vec) const;
|
||||||
|
bool operator<=(const NzVector2& vec) const;
|
||||||
|
bool operator>(const NzVector2& vec) const;
|
||||||
|
bool operator>=(const NzVector2& vec) const;
|
||||||
|
|
||||||
|
T x;
|
||||||
|
T y;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> std::ostream& operator<<(std::ostream& out, const NzVector2<T>& vec);
|
||||||
|
|
||||||
|
template<typename T> NzVector2<T> operator*(T scale, const NzVector2<T>& vec);
|
||||||
|
template<typename T> NzVector2<T> operator/(T scale, const NzVector2<T>& vec);
|
||||||
|
|
||||||
|
typedef NzVector2<double> NzVector2d;
|
||||||
|
typedef NzVector2<float> NzVector2f;
|
||||||
|
typedef NzVector2<int> NzVector2i;
|
||||||
|
|
||||||
|
#include <Nazara/Math/Vector2.inl>
|
||||||
|
|
||||||
|
#endif // NAZARA_VECTOR2_HPP
|
||||||
|
|
@ -0,0 +1,369 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
|
#include <Nazara/Math/Basic.hpp>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>::NzVector2()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>::NzVector2(T X, T Y) :
|
||||||
|
x(X),
|
||||||
|
y(Y)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>::NzVector2(T scale) :
|
||||||
|
x(scale),
|
||||||
|
y(scale)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>::NzVector2(T vec[2]) :
|
||||||
|
x(vec[0]),
|
||||||
|
y(vec[1])
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
NzVector2<T>::NzVector2(const NzVector2<U>& vec) :
|
||||||
|
x(static_cast<T>(vec.x)),
|
||||||
|
y(static_cast<T>(vec.y))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector2<T>::AbsDotProduct(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return std::fabs(x * vec.x) + std::fabs(y * vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> inline int NzVector2<int>::AbsDotProduct(const NzVector2<int>& vec) const
|
||||||
|
{
|
||||||
|
return std::labs(x * vec.x) + std::labs(y * vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
double NzVector2<T>::Distance(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return std::sqrt(SquaredDistance(vec));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector2<T>::DotProduct(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return x * vec.x + y * vec.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzVector2<T>::GetNormal() const
|
||||||
|
{
|
||||||
|
NzVector2 vec(*this);
|
||||||
|
vec.Normalize();
|
||||||
|
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzVector2<T>::MakeCeil(const NzVector2& vec)
|
||||||
|
{
|
||||||
|
if (vec.x > x)
|
||||||
|
x = vec.x;
|
||||||
|
|
||||||
|
if (vec.y > y)
|
||||||
|
y = vec.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzVector2<T>::MakeFloor(const NzVector2& vec)
|
||||||
|
{
|
||||||
|
if (vec.x < x)
|
||||||
|
x = vec.x;
|
||||||
|
|
||||||
|
if (vec.y < y)
|
||||||
|
y = vec.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
double NzVector2<T>::Length() const
|
||||||
|
{
|
||||||
|
return std::sqrt(SquaredLength());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
double NzVector2<T>::Normalize()
|
||||||
|
{
|
||||||
|
double length = Length();
|
||||||
|
|
||||||
|
if (length != 0.f)
|
||||||
|
{
|
||||||
|
x /= length;
|
||||||
|
y /= length;
|
||||||
|
}
|
||||||
|
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector2<T>::SquaredDistance(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return operator-(vec).SquaredLength();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector2<T>::SquaredLength() const
|
||||||
|
{
|
||||||
|
return x * x + y * y;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzString NzVector2<T>::ToString() const
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
|
||||||
|
return ss << "Vector2(" << x << ", " << y << ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>::operator NzString() const
|
||||||
|
{
|
||||||
|
return ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T& NzVector2<T>::operator[](unsigned int i)
|
||||||
|
{
|
||||||
|
if (i >= 2)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Index out of range (" << i << " >= 2)";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return *(&x+i);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector2<T>::operator[](unsigned int i) const
|
||||||
|
{
|
||||||
|
if (i >= 2)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Index out of range (" << i << " >= 2)";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return *(&x+i);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
const NzVector2<T>& NzVector2<T>::operator+() const
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzVector2<T>::operator-() const
|
||||||
|
{
|
||||||
|
return NzVector2(-x, -y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzVector2<T>::operator+(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return NzVector2(x + vec.x, y + vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzVector2<T>::operator-(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return NzVector2(x - vec.x, y - vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzVector2<T>::operator*(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return NzVector2(x * vec.x, y * vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzVector2<T>::operator*(T scale) const
|
||||||
|
{
|
||||||
|
return NzVector2(x * scale, y * scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzVector2<T>::operator/(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector2(x / vec.x, y / vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> NzVector2<T>::operator/(T scale) const
|
||||||
|
{
|
||||||
|
if (scale == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector2(x / scale, y / scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>& NzVector2<T>::operator+=(const NzVector2& vec)
|
||||||
|
{
|
||||||
|
x += vec.x;
|
||||||
|
y += vec.y;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>& NzVector2<T>::operator-=(const NzVector2& vec)
|
||||||
|
{
|
||||||
|
x -= vec.x;
|
||||||
|
y -= vec.y;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>& NzVector2<T>::operator*=(const NzVector2& vec)
|
||||||
|
{
|
||||||
|
x *= vec.x;
|
||||||
|
y *= vec.y;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>& NzVector2<T>::operator*=(T scale)
|
||||||
|
{
|
||||||
|
x *= scale;
|
||||||
|
y *= scale;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>& NzVector2<T>::operator/=(const NzVector2& vec)
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
x /= vec.x;
|
||||||
|
y /= vec.y;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T>& NzVector2<T>::operator/=(T scale)
|
||||||
|
{
|
||||||
|
if (scale == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
x /= scale;
|
||||||
|
y /= scale;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector2<T>::operator==(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return NzNumberEquals(x, vec.x) &&
|
||||||
|
NzNumberEquals(y, vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector2<T>::operator!=(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return !operator==(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector2<T>::operator<(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return x < vec.x && y < vec.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector2<T>::operator<=(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return operator<(vec) || operator==(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector2<T>::operator>(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return !operator<=(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector2<T>::operator>=(const NzVector2& vec) const
|
||||||
|
{
|
||||||
|
return !operator<(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::ostream& operator<<(std::ostream& out, const NzVector2<T>& vec)
|
||||||
|
{
|
||||||
|
return out << vec.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> operator*(T scale, const NzVector2<T>& vec)
|
||||||
|
{
|
||||||
|
return NzVector2<T>(scale * vec.x, scale * vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector2<T> operator/(T scale, const NzVector2<T>& vec)
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector2<T>(scale/vec.x, scale/vec.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
// Copyright (C) 2012 Rémi Begues
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_VECTOR3_HPP
|
||||||
|
#define NAZARA_VECTOR3_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
template<typename T> class NzVector3
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzVector3();
|
||||||
|
NzVector3(T X, T Y, T Z);
|
||||||
|
explicit NzVector3(T scale);
|
||||||
|
NzVector3(T vec[3]);
|
||||||
|
template<typename U> explicit NzVector3(const NzVector3<U>& vec);
|
||||||
|
NzVector3(const NzVector3& vec) = default;
|
||||||
|
~NzVector3() = default;
|
||||||
|
|
||||||
|
T AbsDotProduct(const NzVector3& vec) const;
|
||||||
|
NzVector3 CrossProduct(const NzVector3& vec) const;
|
||||||
|
double Distance(const NzVector3& vec) const;
|
||||||
|
T DotProduct(const NzVector3& vec) const;
|
||||||
|
NzVector3 GetNormal() const;
|
||||||
|
void MakeCeil(const NzVector3& vec);
|
||||||
|
void MakeFloor(const NzVector3& vec);
|
||||||
|
double Length() const;
|
||||||
|
double Normalize();
|
||||||
|
T SquaredDistance(const NzVector3& vec) const;
|
||||||
|
T SquaredLength() const;
|
||||||
|
|
||||||
|
NzString ToString() const;
|
||||||
|
|
||||||
|
operator NzString() const;
|
||||||
|
|
||||||
|
T& operator[](unsigned int i);
|
||||||
|
T operator[](unsigned int i) const;
|
||||||
|
|
||||||
|
const NzVector3& operator+() const;
|
||||||
|
NzVector3 operator-() const;
|
||||||
|
|
||||||
|
NzVector3 operator+(const NzVector3& vec) const;
|
||||||
|
NzVector3 operator-(const NzVector3& vec) const;
|
||||||
|
NzVector3 operator*(const NzVector3& vec) const;
|
||||||
|
NzVector3 operator*(T scale) const;
|
||||||
|
NzVector3 operator/(const NzVector3& vec) const;
|
||||||
|
NzVector3 operator/(T scale) const;
|
||||||
|
|
||||||
|
NzVector3& operator+=(const NzVector3& vec);
|
||||||
|
NzVector3& operator-=(const NzVector3& vec);
|
||||||
|
NzVector3& operator*=(const NzVector3& vec);
|
||||||
|
NzVector3& operator*=(T scale);
|
||||||
|
NzVector3& operator/=(const NzVector3& vec);
|
||||||
|
NzVector3& operator/=(T scale);
|
||||||
|
|
||||||
|
bool operator==(const NzVector3& vec) const;
|
||||||
|
bool operator!=(const NzVector3& vec) const;
|
||||||
|
bool operator<(const NzVector3& vec) const;
|
||||||
|
bool operator<=(const NzVector3& vec) const;
|
||||||
|
bool operator>(const NzVector3& vec) const;
|
||||||
|
bool operator>=(const NzVector3& vec) const;
|
||||||
|
|
||||||
|
T x;
|
||||||
|
T y;
|
||||||
|
T z;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> std::ostream& operator<<(std::ostream& out, const NzVector3<T>& vec);
|
||||||
|
|
||||||
|
template<typename T> NzVector3<T> operator*(T scale, const NzVector3<T>& vec);
|
||||||
|
template<typename T> NzVector3<T> operator/(T scale, const NzVector3<T>& vec);
|
||||||
|
|
||||||
|
typedef NzVector3<double> NzVector3d;
|
||||||
|
typedef NzVector3<float> NzVector3f;
|
||||||
|
typedef NzVector3<int> NzVector3i;
|
||||||
|
|
||||||
|
#include <Nazara/Math/Vector3.inl>
|
||||||
|
|
||||||
|
#endif // NAZARA_VECTOR3_HPP
|
||||||
|
|
@ -0,0 +1,393 @@
|
||||||
|
// Copyright (C) 2012 Rémi Begues
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
|
#include <Nazara/Math/Basic.hpp>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>::NzVector3()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>::NzVector3(T X, T Y, T Z) :
|
||||||
|
x(X),
|
||||||
|
y(Y),
|
||||||
|
z(Z)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>::NzVector3(T scale) :
|
||||||
|
x(scale),
|
||||||
|
y(scale),
|
||||||
|
z(scale)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>::NzVector3(T vec[3]) :
|
||||||
|
x(vec[0]),
|
||||||
|
y(vec[1]),
|
||||||
|
z(vec[2])
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
NzVector3<T>::NzVector3(const NzVector3<U>& vec) :
|
||||||
|
x(static_cast<T>(vec.x)),
|
||||||
|
y(static_cast<T>(vec.y)),
|
||||||
|
z(static_cast<T>(vec.z))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector3<T>::AbsDotProduct(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return std::fabs(x * vec.x) + std::fabs(y * vec.y) + std::fabs(z * vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> inline int NzVector3<int>::AbsDotProduct(const NzVector3<int>& vec) const
|
||||||
|
{
|
||||||
|
return std::labs(x * vec.x) + std::labs(y * vec.y) + std::labs(z * vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::CrossProduct(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return NzVector3(y * vec.z - z * vec.y, z * vec.x - x * vec.y, x * vec.y - y * vec.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
double NzVector3<T>::Distance(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return std::sqrt(SquaredDistance(vec));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector3<T>::DotProduct(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return x * vec.x + y * vec.y + z * vec.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::GetNormal() const
|
||||||
|
{
|
||||||
|
NzVector3 vec(*this);
|
||||||
|
vec.Normalize();
|
||||||
|
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzVector3<T>::MakeCeil(const NzVector3& vec)
|
||||||
|
{
|
||||||
|
if (vec.x > x)
|
||||||
|
x = vec.x;
|
||||||
|
|
||||||
|
if (vec.y > y)
|
||||||
|
y = vec.y;
|
||||||
|
|
||||||
|
if (vec.z > z)
|
||||||
|
z = vec.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzVector3<T>::MakeFloor(const NzVector3& vec)
|
||||||
|
{
|
||||||
|
if (vec.x < x)
|
||||||
|
x = vec.x;
|
||||||
|
|
||||||
|
if (vec.y < y)
|
||||||
|
y = vec.y;
|
||||||
|
|
||||||
|
if (vec.z < z)
|
||||||
|
z = vec.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
double NzVector3<T>::Length() const
|
||||||
|
{
|
||||||
|
return std::sqrt(SquaredLength());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
double NzVector3<T>::Normalize()
|
||||||
|
{
|
||||||
|
double length = Length();
|
||||||
|
|
||||||
|
if (length != 0.f)
|
||||||
|
{
|
||||||
|
x /= length;
|
||||||
|
y /= length;
|
||||||
|
z /= length;
|
||||||
|
}
|
||||||
|
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector3<T>::SquaredDistance(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return operator-(vec).SquaredLength();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector3<T>::SquaredLength() const
|
||||||
|
{
|
||||||
|
return x * x + y * y + z * z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzString NzVector3<T>::ToString() const
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
|
||||||
|
return ss << "Vector3(" << x << ", " << y << ", " << z <<')';
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>::operator NzString() const
|
||||||
|
{
|
||||||
|
return ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T& NzVector3<T>::operator[](unsigned int i)
|
||||||
|
{
|
||||||
|
if (i >= 3)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Index out of range (" << i << " >= 3)";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return *(&x+i);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector3<T>::operator[](unsigned int i) const
|
||||||
|
{
|
||||||
|
if (i >= 3)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Index out of range (" << i << " >= 3)";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return *(&x+i);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
const NzVector3<T>& NzVector3<T>::operator+() const
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::operator-() const
|
||||||
|
{
|
||||||
|
return NzVector3(-x, -y, -z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::operator+(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return NzVector3(x + vec.x, y + vec.y, z + vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::operator-(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return NzVector3(x - vec.x, y - vec.y, z - vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::operator*(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return NzVector3(x * vec.x, y * vec.y, z * vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::operator*(T scale) const
|
||||||
|
{
|
||||||
|
return NzVector3(x * scale, y * scale, z * scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::operator/(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f || vec.z == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector3(x / vec.x, y / vec.y, z / vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> NzVector3<T>::operator/(T scale) const
|
||||||
|
{
|
||||||
|
if (scale == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector3(x / scale, y / scale, z / scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>& NzVector3<T>::operator+=(const NzVector3& vec)
|
||||||
|
{
|
||||||
|
x += vec.x;
|
||||||
|
y += vec.y;
|
||||||
|
z += vec.z;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>& NzVector3<T>::operator-=(const NzVector3& vec)
|
||||||
|
{
|
||||||
|
x -= vec.x;
|
||||||
|
y -= vec.y;
|
||||||
|
z -= vec.z;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>& NzVector3<T>::operator*=(const NzVector3& vec)
|
||||||
|
{
|
||||||
|
x *= vec.x;
|
||||||
|
y *= vec.y;
|
||||||
|
z *= vec.z;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>& NzVector3<T>::operator*=(T scale)
|
||||||
|
{
|
||||||
|
x *= scale;
|
||||||
|
y *= scale;
|
||||||
|
z *= scale;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>& NzVector3<T>::operator/=(const NzVector3& vec)
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f || vec.z == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
x /= vec.x;
|
||||||
|
y /= vec.y;
|
||||||
|
z /= vec.z;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T>& NzVector3<T>::operator/=(T scale)
|
||||||
|
{
|
||||||
|
if (scale == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
x /= scale;
|
||||||
|
y /= scale;
|
||||||
|
z /= scale;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector3<T>::operator==(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return NzNumberEquals(x, vec.x) &&
|
||||||
|
NzNumberEquals(y, vec.y) &&
|
||||||
|
NzNumberEquals(z, vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector3<T>::operator!=(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return !operator==(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector3<T>::operator<(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return x < vec.x && y < vec.y && z < vec.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector3<T>::operator<=(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return operator<(vec) || operator==(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector3<T>::operator>(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return !operator<=(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector3<T>::operator>=(const NzVector3& vec) const
|
||||||
|
{
|
||||||
|
return !operator<(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::ostream& operator<<(std::ostream& out, const NzVector3<T>& vec)
|
||||||
|
{
|
||||||
|
return out << vec.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> operator*(T scale, const NzVector3<T>& vec)
|
||||||
|
{
|
||||||
|
return NzVector3<T>(scale * vec.x, scale * vec.y, scale * vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector3<T> operator/(T scale, const NzVector3<T>& vec)
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f || vec.z == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector3<T>(scale / vec.x, scale / vec.y, scale / vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
// Copyright (C) 2012 Rémi Begues
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_VECTOR4_HPP
|
||||||
|
#define NAZARA_VECTOR4_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Core/String.hpp>
|
||||||
|
|
||||||
|
template<typename T> class NzVector4
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzVector4();
|
||||||
|
NzVector4(T X, T Y, T Z, T W = 1.0);
|
||||||
|
explicit NzVector4(T scale);
|
||||||
|
NzVector4(T vec[4]);
|
||||||
|
template<typename U> explicit NzVector4(const NzVector4<U>& vec);
|
||||||
|
NzVector4(const NzVector4& vec) = default;
|
||||||
|
~NzVector4() = default;
|
||||||
|
|
||||||
|
T AbsDotProduct(const NzVector4& vec) const;
|
||||||
|
T DotProduct(const NzVector4& vec) const;
|
||||||
|
void MakeCeil(const NzVector4& vec);
|
||||||
|
void MakeFloor(const NzVector4& vec);
|
||||||
|
void Normalize();
|
||||||
|
|
||||||
|
NzString ToString() const;
|
||||||
|
|
||||||
|
operator NzString() const;
|
||||||
|
|
||||||
|
T& operator[](unsigned int i);
|
||||||
|
T operator[](unsigned int i) const;
|
||||||
|
|
||||||
|
const NzVector4& operator+() const;
|
||||||
|
NzVector4 operator-() const;
|
||||||
|
|
||||||
|
NzVector4 operator+(const NzVector4& vec) const;
|
||||||
|
NzVector4 operator-(const NzVector4& vec) const;
|
||||||
|
NzVector4 operator*(const NzVector4& vec) const;
|
||||||
|
NzVector4 operator*(T scale) const;
|
||||||
|
NzVector4 operator/(const NzVector4& vec) const;
|
||||||
|
NzVector4 operator/(T scale) const;
|
||||||
|
|
||||||
|
NzVector4& operator+=(const NzVector4& vec);
|
||||||
|
NzVector4& operator-=(const NzVector4& vec);
|
||||||
|
NzVector4& operator*=(const NzVector4& vec);
|
||||||
|
NzVector4& operator*=(T scale);
|
||||||
|
NzVector4& operator/=(const NzVector4& vec);
|
||||||
|
NzVector4& operator/=(T scale);
|
||||||
|
|
||||||
|
bool operator==(const NzVector4& vec) const;
|
||||||
|
bool operator!=(const NzVector4& vec) const;
|
||||||
|
bool operator<(const NzVector4& vec) const;
|
||||||
|
bool operator<=(const NzVector4& vec) const;
|
||||||
|
bool operator>(const NzVector4& vec) const;
|
||||||
|
bool operator>=(const NzVector4& vec) const;
|
||||||
|
|
||||||
|
T x;
|
||||||
|
T y;
|
||||||
|
T z;
|
||||||
|
T w;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> std::ostream& operator<<(std::ostream& out, const NzVector4<T>& vec);
|
||||||
|
|
||||||
|
template<typename T> NzVector4<T> operator*(T scale, const NzVector4<T>& vec);
|
||||||
|
template<typename T> NzVector4<T> operator/(T scale, const NzVector4<T>& vec);
|
||||||
|
|
||||||
|
typedef NzVector4<double> NzVector4d;
|
||||||
|
typedef NzVector4<float> NzVector4f;
|
||||||
|
typedef NzVector4<int> NzVector4i;
|
||||||
|
|
||||||
|
#include <Nazara/Math/Vector4.inl>
|
||||||
|
|
||||||
|
#endif // NAZARA_VECTOR4_HPP
|
||||||
|
|
@ -0,0 +1,367 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
|
#include <Nazara/Math/Basic.hpp>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>::NzVector4()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>::NzVector4(T X, T Y, T Z, T W) :
|
||||||
|
x(X),
|
||||||
|
y(Y),
|
||||||
|
z(Z),
|
||||||
|
w(W)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>::NzVector4(T scale) :
|
||||||
|
x(scale),
|
||||||
|
y(scale),
|
||||||
|
z(scale),
|
||||||
|
w(scale)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>::NzVector4(T vec[4]) :
|
||||||
|
x(vec[0]),
|
||||||
|
y(vec[1]),
|
||||||
|
z(vec[2]),
|
||||||
|
w(vec[3])
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
template<typename U>
|
||||||
|
NzVector4<T>::NzVector4(const NzVector4<U>& vec) :
|
||||||
|
x(static_cast<T>(vec.x)),
|
||||||
|
y(static_cast<T>(vec.y)),
|
||||||
|
z(static_cast<T>(vec.z)),
|
||||||
|
w(static_cast<T>(vec.w))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector4<T>::AbsDotProduct(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return std::fabs(x * vec.x) + std::fabs(y * vec.y) + std::fabs(z * vec.z) + std::fabs(w * vec.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> inline int NzVector4<int>::AbsDotProduct(const NzVector4<int>& vec) const
|
||||||
|
{
|
||||||
|
return std::labs(x * vec.x) + std::labs(y * vec.y) + std::labs(z * vec.z) + std::labs(w * vec.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector4<T>::DotProduct(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return x * vec.x + y * vec.y + z * vec.z + w * vec.w;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzVector4<T>::MakeCeil(const NzVector4& vec)
|
||||||
|
{
|
||||||
|
if (vec.x > x)
|
||||||
|
x = vec.x;
|
||||||
|
|
||||||
|
if (vec.y > y)
|
||||||
|
y = vec.y;
|
||||||
|
|
||||||
|
if (vec.z > z)
|
||||||
|
z = vec.z;
|
||||||
|
|
||||||
|
if (vec.w > w)
|
||||||
|
w = vec.w;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzVector4<T>::MakeFloor(const NzVector4& vec)
|
||||||
|
{
|
||||||
|
if (vec.x < x)
|
||||||
|
x = vec.x;
|
||||||
|
|
||||||
|
if (vec.y < y)
|
||||||
|
y = vec.y;
|
||||||
|
|
||||||
|
if (vec.z < z)
|
||||||
|
z = vec.z;
|
||||||
|
|
||||||
|
if (vec.w < w)
|
||||||
|
w = vec.w;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void NzVector4<T>::Normalize()
|
||||||
|
{
|
||||||
|
if (w != 0.f)
|
||||||
|
{
|
||||||
|
x /= w;
|
||||||
|
y /= w;
|
||||||
|
z /= w;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzString NzVector4<T>::ToString() const
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
|
||||||
|
return ss << "Vector4(" << x << ", " << y << ", " << z <<')';
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>::operator NzString() const
|
||||||
|
{
|
||||||
|
return ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T& NzVector4<T>::operator[](unsigned int i)
|
||||||
|
{
|
||||||
|
if (i >= 4)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Index out of range (" << i << " >= 4)";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return *(&x+i);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T NzVector4<T>::operator[](unsigned int i) const
|
||||||
|
{
|
||||||
|
if (i >= 4)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Index out of range (" << i << " >= 4)";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return *(&x+i);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
const NzVector4<T>& NzVector4<T>::operator+() const
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzVector4<T>::operator-() const
|
||||||
|
{
|
||||||
|
return NzVector4(-x, -y, -z, -w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzVector4<T>::operator+(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return NzVector4(x + vec.x, y + vec.y, z + vec.z, w + vec.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzVector4<T>::operator-(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return NzVector4(x - vec.x, y - vec.y, z - vec.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzVector4<T>::operator*(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return NzVector4(x * vec.x, y * vec.y, z * vec.z, w * vec.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzVector4<T>::operator*(T scale) const
|
||||||
|
{
|
||||||
|
return NzVector4(x * scale, y * scale, z * scale, w * scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzVector4<T>::operator/(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f || vec.z == 0.f || vec.w == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector4(x / vec.x, y / vec.y, z / vec.z, w / vec.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> NzVector4<T>::operator/(T scale) const
|
||||||
|
{
|
||||||
|
if (scale == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector4(x / scale, y / scale, z / scale, w / scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>& NzVector4<T>::operator+=(const NzVector4& vec)
|
||||||
|
{
|
||||||
|
x += vec.x;
|
||||||
|
y += vec.y;
|
||||||
|
z += vec.z;
|
||||||
|
w += vec.w;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>& NzVector4<T>::operator-=(const NzVector4& vec)
|
||||||
|
{
|
||||||
|
x -= vec.x;
|
||||||
|
y -= vec.y;
|
||||||
|
z -= vec.z;
|
||||||
|
w -= vec.w;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>& NzVector4<T>::operator*=(const NzVector4& vec)
|
||||||
|
{
|
||||||
|
x *= vec.x;
|
||||||
|
y *= vec.y;
|
||||||
|
z *= vec.z;
|
||||||
|
w *= vec.w;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>& NzVector4<T>::operator*=(T scale)
|
||||||
|
{
|
||||||
|
x *= scale;
|
||||||
|
y *= scale;
|
||||||
|
z *= scale;
|
||||||
|
w *= scale;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>& NzVector4<T>::operator/=(const NzVector4& vec)
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f || vec.z == 0.f || vec.w == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
x /= vec.x;
|
||||||
|
y /= vec.y;
|
||||||
|
z /= vec.z;
|
||||||
|
w /= vec.w;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T>& NzVector4<T>::operator/=(T scale)
|
||||||
|
{
|
||||||
|
if (scale == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
x /= scale;
|
||||||
|
y /= scale;
|
||||||
|
z /= scale;
|
||||||
|
w /= scale;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector4<T>::operator==(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return NzNumberEquals(x, vec.x) &&
|
||||||
|
NzNumberEquals(y, vec.y) &&
|
||||||
|
NzNumberEquals(z, vec.z) &&
|
||||||
|
NzNumberEquals(w, vec.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector4<T>::operator!=(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return !operator==(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector4<T>::operator<(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return x < vec.x && y < vec.y && z < vec.z && w < vec.w;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector4<T>::operator<=(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return operator<(vec) || operator==(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector4<T>::operator>(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return !operator<=(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool NzVector4<T>::operator>=(const NzVector4& vec) const
|
||||||
|
{
|
||||||
|
return !operator<(vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::ostream& operator<<(std::ostream& out, const NzVector4<T>& vec)
|
||||||
|
{
|
||||||
|
return out << vec.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> operator*(T scale, const NzVector4<T>& vec)
|
||||||
|
{
|
||||||
|
return NzVector4<T>(scale * vec.x, scale * vec.y, scale * vec.z, scale * vec.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
NzVector4<T> operator/(T scale, const NzVector4<T>& vec)
|
||||||
|
{
|
||||||
|
if (vec.x == 0.f || vec.y == 0.f || vec.z == 0.f || vec.w == 0.f)
|
||||||
|
{
|
||||||
|
NzStringStream ss;
|
||||||
|
ss << __FILE__ << ':' << __LINE__ << ": Division by zero";
|
||||||
|
|
||||||
|
throw std::domain_error(ss.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return NzVector3<T>(scale / vec.x, scale / vec.y, scale / vec.z, scale / vec.w);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
Nazara Engine
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CONFIG_NETWORK_HPP
|
||||||
|
#define NAZARA_CONFIG_NETWORK_HPP
|
||||||
|
|
||||||
|
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||||
|
|
||||||
|
// Utilise un tracker pour repérer les éventuels leaks (Ralentit l'exécution)
|
||||||
|
#define NAZARA_NETWORK_MEMORYLEAKTRACKER 0
|
||||||
|
|
||||||
|
#endif // NAZARA_CONFIG_NETWORK_HPP
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Network/Config.hpp>
|
||||||
|
#if NAZARA_NETWORK_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||||
|
#define new new(__FILE__, __LINE__)
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#if NAZARA_NETWORK_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#undef delete
|
||||||
|
#undef new
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#ifndef NAZARA_PREREQUESITES_HPP
|
||||||
|
#define NAZARA_PREREQUESITES_HPP
|
||||||
|
|
||||||
|
// Version du moteur
|
||||||
|
#define NAZARA_VERSION_MAJOR 0
|
||||||
|
#define NAZARA_VERSION_MINOR 1
|
||||||
|
|
||||||
|
// (Commenté en attendant GCC 4.7)
|
||||||
|
/*#if __cplusplus < 201103L
|
||||||
|
#error Nazara requires a C++11 compliant compiler
|
||||||
|
#endif*/
|
||||||
|
|
||||||
|
///TODO: Rajouter des tests d'identification de compilateurs
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#define NAZARA_COMPILER_MSVC
|
||||||
|
#define NAZARA_DEPRECATED(txt) __declspec(deprecated(txt))
|
||||||
|
#define NAZARA_FUNCTION __FUNCSIG__
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define NAZARA_COMPILER_GCC
|
||||||
|
#define NAZARA_FUNCTION __PRETTY_FUNCTION__
|
||||||
|
|
||||||
|
#define NAZARA_DEPRECATED(txt) __attribute__((__deprecated__(txt)))
|
||||||
|
#elif defined(__BORLANDC__)
|
||||||
|
#define NAZARA_COMPILER_BORDLAND
|
||||||
|
#define NAZARA_DEPRECATED(txt)
|
||||||
|
#define NAZARA_FUNCTION __FUNC__
|
||||||
|
#else
|
||||||
|
#define NAZARA_COMPILER_UNKNOWN
|
||||||
|
#define NAZARA_DEPRECATED(txt)
|
||||||
|
#define NAZARA_FUNCTION __func__ // __func__ est standard depuis le C++11
|
||||||
|
#error This compiler is not fully supported
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NazaraUnused(a) (void) a
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(__WIN32__) || defined(NAZARA_PLATFORM_WINDOWSVISTA)
|
||||||
|
#if !defined(NAZARA_STATIC)
|
||||||
|
#ifdef NAZARA_BUILD
|
||||||
|
#define NAZARA_API __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define NAZARA_API __declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define NAZARA_API
|
||||||
|
#endif
|
||||||
|
#define NAZARA_PLATFORM_WINDOWS
|
||||||
|
|
||||||
|
// Des defines pour le header Windows
|
||||||
|
#if defined(NAZARA_BUILD) // Pour ne pas entrer en conflit avec les defines de l'application ou d'une autre bibliothèque
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NOMINMAX
|
||||||
|
#define NOMINMAX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
|
#ifdef NAZARA_PLATFORM_WINDOWSVISTA
|
||||||
|
#define _WIN32_WINNT 0x0600 // Version de Windows minimale : Vista
|
||||||
|
#else
|
||||||
|
#define _WIN32_WINNT 0x0501 // Version de Windows minimale : XP
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#elif defined(linux) || defined(__linux)
|
||||||
|
#if !defined(NAZARA_STATIC) && defined(NAZARA_COMPILER_GCC)
|
||||||
|
#define NAZARA_API __attribute__((visibility ("default")))
|
||||||
|
#else
|
||||||
|
#define NAZARA_API
|
||||||
|
#endif
|
||||||
|
#define NAZARA_PLATFORM_LINUX
|
||||||
|
#define NAZARA_PLATFORM_POSIX
|
||||||
|
/*#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
|
||||||
|
#define NAZARA_API
|
||||||
|
#define NAZARA_PLATFORM_MACOS
|
||||||
|
#define NAZARA_PLATFORM_POSIX
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
#define NAZARA_API
|
||||||
|
#define NAZARA_PLATFORM_FREEBSD
|
||||||
|
#define NAZARA_PLATFORM_POSIX*/
|
||||||
|
#else
|
||||||
|
// À commenter pour tenter quand même une compilation
|
||||||
|
#error This operating system is not fully supported by the Nazara Engine
|
||||||
|
|
||||||
|
#define NAZARA_PLATFORM_UNKNOWN
|
||||||
|
#define NAZARA_API
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(NAZARA_DEBUG) && !defined(NDEBUG)
|
||||||
|
#define NDEBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
typedef int8_t nzInt8;
|
||||||
|
typedef uint8_t nzUInt8;
|
||||||
|
|
||||||
|
typedef int16_t nzInt16;
|
||||||
|
typedef uint16_t nzUInt16;
|
||||||
|
|
||||||
|
typedef int32_t nzInt32;
|
||||||
|
typedef uint32_t nzUInt32;
|
||||||
|
|
||||||
|
typedef int64_t nzInt64;
|
||||||
|
typedef uint64_t nzUInt64;
|
||||||
|
|
||||||
|
#endif // NAZARA_PREREQUESITES_HPP
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_BUFFER_HPP
|
||||||
|
#define NAZARA_BUFFER_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Utility/Resource.hpp>
|
||||||
|
|
||||||
|
enum nzBufferLock
|
||||||
|
{
|
||||||
|
nzBufferLock_DiscardAndWrite,
|
||||||
|
nzBufferLock_ReadOnly,
|
||||||
|
nzBufferLock_ReadWrite,
|
||||||
|
nzBufferLock_WriteOnly
|
||||||
|
};
|
||||||
|
|
||||||
|
enum nzBufferStorage
|
||||||
|
{
|
||||||
|
nzBufferStorage_Hardware,
|
||||||
|
nzBufferStorage_Software
|
||||||
|
};
|
||||||
|
|
||||||
|
enum nzBufferType
|
||||||
|
{
|
||||||
|
nzBufferType_Index,
|
||||||
|
nzBufferType_Vertex
|
||||||
|
};
|
||||||
|
|
||||||
|
enum nzBufferUsage
|
||||||
|
{
|
||||||
|
nzBufferUsage_Dynamic,
|
||||||
|
nzBufferUsage_Static
|
||||||
|
};
|
||||||
|
|
||||||
|
class NzBufferImpl;
|
||||||
|
class NzRenderer;
|
||||||
|
|
||||||
|
class NAZARA_API NzBuffer : public NzResource
|
||||||
|
{
|
||||||
|
friend class NzRenderer;
|
||||||
|
|
||||||
|
public:
|
||||||
|
NzBuffer(nzBufferType type);
|
||||||
|
NzBuffer(nzBufferType type, unsigned int length, nzUInt8 typeSize, nzBufferUsage usage = nzBufferUsage_Static);
|
||||||
|
~NzBuffer();
|
||||||
|
|
||||||
|
bool CopyContent(NzBuffer& buffer);
|
||||||
|
|
||||||
|
bool Create(unsigned int length, nzUInt8 typeSize, nzBufferUsage usage = nzBufferUsage_Static);
|
||||||
|
void Destroy();
|
||||||
|
|
||||||
|
bool Fill(const void* data, unsigned int offset, unsigned int length);
|
||||||
|
|
||||||
|
unsigned int GetLength() const;
|
||||||
|
unsigned int GetSize() const;
|
||||||
|
nzBufferStorage GetStorage() const;
|
||||||
|
nzBufferType GetType() const;
|
||||||
|
nzUInt8 GetTypeSize() const;
|
||||||
|
nzBufferUsage GetUsage() const;
|
||||||
|
|
||||||
|
bool IsHardware() const;
|
||||||
|
|
||||||
|
void* Lock(nzBufferLock lock, unsigned int offset = 0, unsigned int length = 0);
|
||||||
|
bool Unlock();
|
||||||
|
|
||||||
|
static bool IsHardwareSupported();
|
||||||
|
|
||||||
|
private:
|
||||||
|
nzBufferStorage m_storage;
|
||||||
|
nzBufferType m_type;
|
||||||
|
nzBufferUsage m_usage;
|
||||||
|
nzUInt8 m_typeSize;
|
||||||
|
NzBufferImpl* m_impl;
|
||||||
|
unsigned int m_length;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // NAZARA_BUFFER_HPP
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
Nazara Engine
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CONFIG_RENDERER_HPP
|
||||||
|
#define NAZARA_CONFIG_RENDERER_HPP
|
||||||
|
|
||||||
|
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||||
|
|
||||||
|
// Active une fenêtre de rendu (NzRenderWindow) lors de sa création
|
||||||
|
#define NAZARA_RENDERER_ACTIVATE_RENDERWINDOW_ON_CREATION 1
|
||||||
|
|
||||||
|
// Force les buffers à posséder un stride multiple de 32 bytes (Gain de performances sur certaines cartes)
|
||||||
|
#define NAZARA_RENDERER_FORCE_DECLARATION_STRIDE_MULTIPLE_OF_32 0
|
||||||
|
|
||||||
|
// Utilise un tracker pour repérer les éventuels leaks (Ralentit l'exécution)
|
||||||
|
#define NAZARA_RENDERER_MEMORYLEAKTRACKER 0
|
||||||
|
|
||||||
|
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||||
|
#define NAZARA_RENDERER_SAFE 1
|
||||||
|
|
||||||
|
// Fait en sorte que le Renderer soit un singleton plutôt qu'une instance globale
|
||||||
|
#define NAZARA_RENDERER_SINGLETON 0
|
||||||
|
|
||||||
|
#endif // NAZARA_CONFIG_MODULENAME_HPP
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#ifdef NAZARA_RENDERER_COMMON
|
||||||
|
#error This file is not part of the common renderer interface, you must undefine NAZARA_RENDERER_COMMON to use it
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CONTEXT_HPP
|
||||||
|
#define NAZARA_CONTEXT_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Renderer/ContextParameters.hpp>
|
||||||
|
|
||||||
|
class NzContextImpl;
|
||||||
|
|
||||||
|
class NAZARA_API NzContext
|
||||||
|
{
|
||||||
|
friend class NzContextImpl;
|
||||||
|
|
||||||
|
public:
|
||||||
|
NzContext();
|
||||||
|
~NzContext();
|
||||||
|
|
||||||
|
bool Create(const NzContextParameters& parameters = NzContextParameters());
|
||||||
|
const NzContextParameters& GetParameters() const;
|
||||||
|
bool IsActive() const;
|
||||||
|
bool SetActive(bool active);
|
||||||
|
void SwapBuffers();
|
||||||
|
|
||||||
|
static const NzContext* GetCurrent();
|
||||||
|
static const NzContext* GetReference();
|
||||||
|
static bool InitializeReference();
|
||||||
|
static void UninitializeReference();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzContextParameters m_parameters;
|
||||||
|
NzContextImpl* m_impl;
|
||||||
|
|
||||||
|
static NzContext* s_reference;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // NAZARA_CONTEXT_HPP
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_CONTEXTPARAMETERS_HPP
|
||||||
|
#define NAZARA_CONTEXTPARAMETERS_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Renderer/RenderTargetParameters.hpp>
|
||||||
|
#include <Nazara/Utility/VideoMode.hpp>
|
||||||
|
#include <Nazara/Utility/WindowHandle.hpp>
|
||||||
|
|
||||||
|
class NzContext;
|
||||||
|
|
||||||
|
struct NAZARA_API NzContextParameters
|
||||||
|
{
|
||||||
|
NzContextParameters(const NzRenderTargetParameters& parameters = NzRenderTargetParameters()) :
|
||||||
|
antialiasingLevel(parameters.antialiasingLevel),
|
||||||
|
bitsPerPixel(NzVideoMode::GetDesktopMode().bitsPerPixel),
|
||||||
|
depthBits(parameters.depthBits),
|
||||||
|
majorVersion(defaultMajorVersion),
|
||||||
|
minorVersion(defaultMinorVersion),
|
||||||
|
stencilBits(parameters.stencilBits),
|
||||||
|
shareContext(defaultShareContext),
|
||||||
|
window(defaultWindow),
|
||||||
|
compatibilityProfile(defaultCompatibilityProfile),
|
||||||
|
doubleBuffered(defaultDoubleBuffered),
|
||||||
|
shared(defaultShared)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
nzUInt8 antialiasingLevel;
|
||||||
|
nzUInt8 bitsPerPixel;
|
||||||
|
nzUInt8 depthBits;
|
||||||
|
nzUInt8 majorVersion;
|
||||||
|
nzUInt8 minorVersion;
|
||||||
|
nzUInt8 stencilBits;
|
||||||
|
const NzContext* shareContext;
|
||||||
|
NzWindowHandle window;
|
||||||
|
bool compatibilityProfile;
|
||||||
|
bool doubleBuffered;
|
||||||
|
bool shared;
|
||||||
|
|
||||||
|
static nzUInt8 defaultMajorVersion;
|
||||||
|
static nzUInt8 defaultMinorVersion;
|
||||||
|
static const NzContext* defaultShareContext;
|
||||||
|
static NzWindowHandle defaultWindow;
|
||||||
|
static bool defaultCompatibilityProfile;
|
||||||
|
static bool defaultDoubleBuffered;
|
||||||
|
static bool defaultShared;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // NAZARA_CONTEXTPARAMETERS_HPP
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Renderer/Config.hpp>
|
||||||
|
#if NAZARA_RENDERER_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||||
|
|
||||||
|
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||||
|
#define new new(__FILE__, __LINE__)
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#if NAZARA_RENDERER_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||||
|
#undef delete
|
||||||
|
#undef new
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
// Copyright (C) 2012 Jérôme Leclercq
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_INDEXBUFFER_HPP
|
||||||
|
#define NAZARA_INDEXBUFFER_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <Nazara/Renderer/Buffer.hpp>
|
||||||
|
|
||||||
|
class NAZARA_API NzIndexBuffer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NzIndexBuffer(NzBuffer* buffer, unsigned int startIndex, unsigned int indexCount);
|
||||||
|
NzIndexBuffer(unsigned int length, nzUInt8 indexSize, nzBufferUsage usage = nzBufferUsage_Static);
|
||||||
|
NzIndexBuffer(const NzIndexBuffer& indexBuffer);
|
||||||
|
~NzIndexBuffer();
|
||||||
|
|
||||||
|
bool Fill(const void* data, unsigned int offset, unsigned int length);
|
||||||
|
|
||||||
|
NzBuffer* GetBuffer() const;
|
||||||
|
nzUInt8 GetIndexSize() const;
|
||||||
|
unsigned int GetIndexCount() const;
|
||||||
|
unsigned int GetStartIndex() const;
|
||||||
|
|
||||||
|
bool IsHardware() const;
|
||||||
|
bool IsSequential() const;
|
||||||
|
|
||||||
|
void* Lock(nzBufferLock lock, unsigned int offset = 0, unsigned int length = 0);
|
||||||
|
bool Unlock();
|
||||||
|
|
||||||
|
private:
|
||||||
|
NzBuffer* m_buffer;
|
||||||
|
bool m_ownsBuffer;
|
||||||
|
unsigned int m_indexCount;
|
||||||
|
unsigned int m_startIndex;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // NAZARA_INDEXBUFFER_HPP
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue