Refactored mathematics module
Added AABBs Added code examples Added experimental support for texture arrays (1D/2D) Added initialisers (new way of initialising modules) Added global headers (Plus a global header generator script) Added pattern support for directory Added support for spinlocks critical section on Windows Added NzRenderWindow::SetFramerateLimit Core project now includes Mathematics files Fixed color implementation using double Fixed declaration needing renderer include Fixed MLT not clearing nextFree(File/Line) after Free Fixed move operators not being noexcept Fixed thread-safety (Now working correctly - If I'm lucky) Moved Resource to core New interface for modules New interface for the renderer Put some global functions to anonymous namespace Removed empty modules Renamed ThreadCondition to ConditionVariable Replaced redirect to cerr log option by duplicate to cout Setting mouse position relative to a window will make this window ignore the event Shaders sending methods no longer takes the uniform variable name (it's using ID instead) Using new OpenGL 4.3 header
This commit is contained in:
23
examples/ListSequences/build.lua
Normal file
23
examples/ListSequences/build.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
kind "ConsoleApp"
|
||||
|
||||
files "main.cpp"
|
||||
|
||||
configuration "DebugStatic"
|
||||
links "NazaraCored-s"
|
||||
links "NazaraRendererd-s"
|
||||
links "NazaraUtilityd-s"
|
||||
|
||||
configuration "ReleaseStatic"
|
||||
links "NazaraCore-s"
|
||||
links "NazaraRenderer-s"
|
||||
links "NazaraUtility-s"
|
||||
|
||||
configuration "DebugDLL"
|
||||
links "NazaraCored"
|
||||
links "NazaraRendererd"
|
||||
links "NazaraUtilityd"
|
||||
|
||||
configuration "ReleaseDLL"
|
||||
links "NazaraCore"
|
||||
links "NazaraRenderer"
|
||||
links "NazaraUtility"
|
||||
49
examples/ListSequences/main.cpp
Normal file
49
examples/ListSequences/main.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#include <Nazara/Utility/Mesh.hpp>
|
||||
#include <Nazara/Utility/Utility.hpp>
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
// Pour charger des ressources, il est impératif d'initialiser le module utilitaire
|
||||
NzInitializer<NzUtility> utility;
|
||||
if (!utility)
|
||||
{
|
||||
// Ça n'a pas fonctionné, le pourquoi se trouve dans le fichier NazaraLog.log
|
||||
std::cout << "Failed to initialize Nazara, see NazaraLog.log for further informations" << std::endl;
|
||||
std::getchar(); // On laise le temps de voir l'erreur
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Le Renderer n'étant pas chargé, nous devons indiquer que nous désirons un stockage software de notre mesh
|
||||
NzMeshParams parameters;
|
||||
parameters.storage = nzBufferStorage_Software;
|
||||
|
||||
NzMesh drfreak;
|
||||
if (!drfreak.LoadFromFile("resources/drfreak.md2", parameters))
|
||||
{
|
||||
std::cout << "Failed to load Dr. Freak's mesh" << std::endl;
|
||||
std::getchar();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (drfreak.HasAnimation()) // Si le mesh possède des animations
|
||||
{
|
||||
std::cout << "Mesh has animation" << std::endl;
|
||||
|
||||
// Un objet NzAnimation représente un ensemble d'informations sur des animations
|
||||
const NzAnimation* animation = drfreak.GetAnimation();
|
||||
|
||||
// Une séquence définit une "action", chaque séquence possède un nom, une frame de départ, une d'arrivée ainsi qu'un framerate
|
||||
unsigned int sequenceCount = animation->GetSequenceCount();
|
||||
std::cout << sequenceCount << " sequences:" << std::endl;
|
||||
for (unsigned int i = 0; i < sequenceCount; ++i)
|
||||
std::cout << "-" << (i+1) << ": " << animation->GetSequence(i)->name << std::endl;
|
||||
}
|
||||
else
|
||||
std::cout << "Mesh has no animation" << std::endl;
|
||||
|
||||
std::getchar(); // Une attente pour avoir le temps de lire :-)
|
||||
|
||||
// Le module utilitaire et le mesh sont déchargés automatiquement
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user