mirror of
https://github.com/borgesdan/xn65
synced 2024-12-29 21:54:47 +01:00
Implementa PlatformInit
This commit is contained in:
parent
2addc59a42
commit
01af08b711
@ -6,9 +6,11 @@
|
|||||||
#include "platform-dx/implementations.hpp"
|
#include "platform-dx/implementations.hpp"
|
||||||
|
|
||||||
namespace xna {
|
namespace xna {
|
||||||
|
void Platform::Init() {
|
||||||
|
PlatformInit::Init();
|
||||||
|
}
|
||||||
|
|
||||||
void InitPlatform::InitRegisteredTypes()
|
void PlatformInit::InitRegisteredTypes()
|
||||||
{
|
{
|
||||||
insertRegisteredReader<ObjectReader>("ObjecReader");
|
insertRegisteredReader<ObjectReader>("ObjecReader");
|
||||||
insertRegisteredReader<BooleanReader>("BooleanReader");
|
insertRegisteredReader<BooleanReader>("BooleanReader");
|
||||||
@ -35,7 +37,7 @@ namespace xna {
|
|||||||
insertRegisteredReader<Texture2DReader>("Texture2DReader");
|
insertRegisteredReader<Texture2DReader>("Texture2DReader");
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitPlatform::InitActivadors()
|
void PlatformInit::InitActivadors()
|
||||||
{
|
{
|
||||||
insertActivadorReader<ObjectReader>();
|
insertActivadorReader<ObjectReader>();
|
||||||
insertActivadorReader<BooleanReader>();
|
insertActivadorReader<BooleanReader>();
|
||||||
|
@ -62,7 +62,7 @@ namespace xna {
|
|||||||
|
|
||||||
|
|
||||||
int APIENTRY WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) {
|
int APIENTRY WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) {
|
||||||
xna::InitPlatform::Init();
|
xna::Platform::Init();
|
||||||
|
|
||||||
auto game = xna::Game1();
|
auto game = xna::Game1();
|
||||||
const auto result = game.Run();
|
const auto result = game.Run();
|
||||||
|
@ -30,7 +30,7 @@ namespace xna {
|
|||||||
&& textureCoordinate == other.textureCoordinate;
|
&& textureCoordinate == other.textureCoordinate;
|
||||||
}
|
}
|
||||||
|
|
||||||
VertexPositionTexture(const Vector3& position, const Vector2& textureCoordinate)
|
constexpr VertexPositionTexture(const Vector3& position, const Vector2& textureCoordinate)
|
||||||
: position(position), textureCoordinate(textureCoordinate)
|
: position(position), textureCoordinate(textureCoordinate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ namespace xna {
|
|||||||
&& color == other.color;
|
&& color == other.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
VertexPositionColorTexture(const Vector3& position, const Vector2& textureCoodinate, const Color& color)
|
constexpr VertexPositionColorTexture(const Vector3& position, const Vector2& textureCoodinate, const Color& color)
|
||||||
: position(position), textureCoodinate(textureCoodinate), color(color)
|
: position(position), textureCoodinate(textureCoodinate), color(color)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ namespace xna {
|
|||||||
&& textureCoodinate == other.textureCoodinate;
|
&& textureCoodinate == other.textureCoodinate;
|
||||||
}
|
}
|
||||||
|
|
||||||
VertexPositionNormalTexture(const Vector3& position, const Vector3& normal, const Vector2& textureCoodinate)
|
constexpr VertexPositionNormalTexture(const Vector3& position, const Vector3& normal, const Vector2& textureCoodinate)
|
||||||
: position(position), normal(normal), textureCoodinate(textureCoodinate)
|
: position(position), normal(normal), textureCoodinate(textureCoodinate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,10 @@
|
|||||||
#include "../default.hpp"
|
#include "../default.hpp"
|
||||||
#include "../csharp/type.hpp"
|
#include "../csharp/type.hpp"
|
||||||
#include "../content/typereadermanager.hpp"
|
#include "../content/typereadermanager.hpp"
|
||||||
|
#include "../platforminit.hpp"
|
||||||
|
|
||||||
namespace xna {
|
namespace xna {
|
||||||
struct InitPlatform {
|
struct PlatformInit {
|
||||||
static void Init() {
|
static void Init() {
|
||||||
InitRegisteredTypes();
|
InitRegisteredTypes();
|
||||||
InitActivadors();
|
InitActivadors();
|
||||||
@ -30,7 +31,7 @@ namespace xna {
|
|||||||
return reinterpret_pointer_cast<ContentTypeReader>(obj);
|
return reinterpret_pointer_cast<ContentTypeReader>(obj);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
10
inc/platforminit.hpp
Normal file
10
inc/platforminit.hpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef XNA_PLATFORMINIT_HPP
|
||||||
|
#define XNA_PLATFORMINIT_HPP
|
||||||
|
|
||||||
|
namespace xna {
|
||||||
|
struct Platform {
|
||||||
|
static void Init();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -50,5 +50,5 @@
|
|||||||
#include "input/gamepad.hpp"
|
#include "input/gamepad.hpp"
|
||||||
#include "input/keyboard.hpp"
|
#include "input/keyboard.hpp"
|
||||||
#include "input/mouse.hpp"
|
#include "input/mouse.hpp"
|
||||||
|
#include "platforminit.hpp"
|
||||||
#include "platform-dx/xna-dx.hpp"
|
#include "platform-dx/xna-dx.hpp"
|
Loading…
x
Reference in New Issue
Block a user