stringSize + STATIC
This commit is contained in:
parent
8e612b1c68
commit
1ae2981d57
@ -17,7 +17,11 @@ set(lib_dest "${export_dest}/${CMAKE_BUILD_TYPE}")
|
|||||||
find_package(PNG REQUIRED)
|
find_package(PNG REQUIRED)
|
||||||
find_package(GLEW REQUIRED)
|
find_package(GLEW REQUIRED)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} SHARED "")
|
|
||||||
|
add_library(${PROJECT_NAME} STATIC "")
|
||||||
|
|
||||||
|
target_compile_definitions(glez PRIVATE
|
||||||
|
_GLIBCXX_USE_CXX11_ABI=0)
|
||||||
|
|
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
|
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class font
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline font(std::string path, float size)
|
inline font(std::string path, float size)
|
||||||
: path(std::move(path)), size(size)
|
: path(std::move(path)), size(size), loaded(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~font();
|
~font();
|
||||||
@ -32,6 +32,7 @@ public:
|
|||||||
|
|
||||||
void load();
|
void load();
|
||||||
void unload();
|
void unload();
|
||||||
|
void stringSize(const std::string &string, float *width, float *height);
|
||||||
|
|
||||||
const std::string path;
|
const std::string path;
|
||||||
const float size;
|
const float size;
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
namespace glez
|
namespace glez
|
||||||
{
|
{
|
||||||
|
|
||||||
|
void preInit();
|
||||||
void init(int width, int height);
|
void init(int width, int height);
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@ void font::load(const std::string &path, float size)
|
|||||||
|
|
||||||
void font::unload()
|
void font::unload()
|
||||||
{
|
{
|
||||||
assert(init);
|
if (!init)
|
||||||
|
return;
|
||||||
|
|
||||||
texture_atlas_delete(atlas);
|
texture_atlas_delete(atlas);
|
||||||
texture_font_delete(font);
|
texture_font_delete(font);
|
||||||
|
@ -28,4 +28,10 @@ void font::unload()
|
|||||||
auto &font = detail::font::get(handle);
|
auto &font = detail::font::get(handle);
|
||||||
font.unload();
|
font.unload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void font::stringSize(const std::string &string, float *width, float *height)
|
||||||
|
{
|
||||||
|
auto &font = detail::font::get(handle);
|
||||||
|
font.stringSize(string, width, height);
|
||||||
|
}
|
||||||
}
|
}
|
@ -13,7 +13,6 @@ namespace glez
|
|||||||
|
|
||||||
void init(int width, int height)
|
void init(int width, int height)
|
||||||
{
|
{
|
||||||
detail::font::init();
|
|
||||||
detail::program::init(width, height);
|
detail::program::init(width, height);
|
||||||
detail::texture::init();
|
detail::texture::init();
|
||||||
}
|
}
|
||||||
@ -39,4 +38,9 @@ void end()
|
|||||||
{
|
{
|
||||||
detail::render::end();
|
detail::render::end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void preInit()
|
||||||
|
{
|
||||||
|
detail::font::init();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user