Move pragmautil.hpp into core
This commit is contained in:
parent
53675a789c
commit
9c76df4faa
|
@ -1,6 +1,6 @@
|
||||||
#include "enginever.hpp"
|
#include "enginever.hpp"
|
||||||
#include "engine.hpp"
|
#include "engine.hpp"
|
||||||
#include <pragmautil.hpp>
|
#include "../pragmautil.hpp"
|
||||||
#include <core/graphics/drawable.hpp>
|
#include <core/graphics/drawable.hpp>
|
||||||
|
|
||||||
namespace hibis {
|
namespace hibis {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace hibis {
|
namespace hibis {
|
||||||
class Node {
|
class Node {
|
||||||
public:
|
public:
|
||||||
virtual void process(float delta) = 0;
|
virtual void process(float delta) {}
|
||||||
virtual void physicsProcess(float delta) = 0;
|
virtual void physicsProcess(float delta) {}
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "resource.hpp"
|
#include "resource.hpp"
|
||||||
#include <pragmautil.hpp>
|
#include "../pragmautil.hpp"
|
||||||
|
|
||||||
namespace hibis {
|
namespace hibis {
|
||||||
TODO("Make this function")
|
TODO("Make this function")
|
||||||
|
|
|
@ -8,7 +8,7 @@ confdata.set('version', meson.project_version())
|
||||||
configure_file(input: 'core/enginever.in.hpp', output: 'enginever.hpp', configuration: confdata)
|
configure_file(input: 'core/enginever.in.hpp', output: 'enginever.hpp', configuration: confdata)
|
||||||
|
|
||||||
# Include Directory
|
# Include Directory
|
||||||
include_dirs = include_directories('./include')
|
include_dirs = [] # include_directories('./include')
|
||||||
|
|
||||||
# Files
|
# Files
|
||||||
libhibis_src_core = files('core/engine/engine.cpp')
|
libhibis_src_core = files('core/engine/engine.cpp')
|
||||||
|
|
|
@ -59,21 +59,16 @@ namespace hibis::rsdl {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSDL::drawText(Resource* resource, std::string text, IntVec2 pos, Color color) {
|
void RSDL::drawText(Resource* resource, std::string text, IntVec2 pos, Color color) {
|
||||||
WARNING("tulip what the hell is this, this sucks.\nAvoid remaking textures every time text has to be drawn")
|
WARNING("(Tulip, this is abysmal) Avoid remaking textures every time text has to be drawn")
|
||||||
if (Font* font = (Font*)resource) {
|
if (Font* font = (Font*)resource) {
|
||||||
SDL_Surface* textSurface = TTF_RenderText_Solid(font->mLoadedFont, text.c_str(), SDL_Color {color.r, color.g, color.b, color.a });
|
SDL_Surface* textSurface = TTF_RenderText_Solid(font->mLoadedFont, text.c_str(), SDL_Color {color.r, color.g, color.b, color.a });
|
||||||
SDL_Texture* textTexture = SDL_CreateTextureFromSurface(mRendererContext, textSurface);
|
SDL_Texture* textTexture = SDL_CreateTextureFromSurface(mRendererContext, textSurface);
|
||||||
|
|
||||||
int width = 0;
|
|
||||||
int height = 0;
|
|
||||||
|
|
||||||
TTF_SizeText(font->mLoadedFont, text.c_str(), &width, &height);
|
|
||||||
|
|
||||||
SDL_Rect textRect;
|
SDL_Rect textRect;
|
||||||
textRect.x = pos.x;
|
textRect.x = pos.x;
|
||||||
textRect.y = pos.y;
|
textRect.y = pos.y;
|
||||||
textRect.w = width;
|
|
||||||
textRect.h = height;
|
TTF_SizeText(font->mLoadedFont, text.c_str(), &textRect.w, &textRect.h);
|
||||||
|
|
||||||
SDL_RenderCopy(mRendererContext, textTexture, NULL, &textRect);
|
SDL_RenderCopy(mRendererContext, textTexture, NULL, &textRect);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <pragmautil.hpp>
|
#include <pragmautil.hpp>
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(_MSC_FULL_VER)
|
#if defined(_MSC_VER) || defined(_MSC_FULL_VER)
|
||||||
WARNING("Please avoid using MSVC in C++ projects utilising std::chrono due to frame timing issues")
|
WARNING("Please avoid using MSVC in C++ projects utilising std::chrono and std::this_thread due to unfixed frame timing issues in the MSVC C++ implementation")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace hibis;
|
using namespace hibis;
|
||||||
|
|
Loading…
Reference in a new issue