Start README
This commit is contained in:
10
README.md
10
README.md
@@ -0,0 +1,10 @@
|
||||
# Josh Graphics Library
|
||||
|
||||
# Goals
|
||||
* Provide single-function-calls to render various graphics primitives in 2D and 3D.
|
||||
* Integrated directly with our other toolkits (ReWindow, J3ML)
|
||||
|
||||
# Non-Goals
|
||||
* Full Rendering Engine
|
||||
* OpenGL/Vulkan Wrapper
|
||||
* Asset Loading & Management
|
5
main.cpp
5
main.cpp
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
//glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
@@ -80,7 +80,8 @@ public:
|
||||
void display()
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
JGL::RenderText("WHATS BOPPIN muth ~~~ niger ~~~ aphuqqa____?", 0.f, -100.f, 1.f);
|
||||
JGL::RenderText("WHATS BOPPIN muth ~~~ niger ~~~ aphuqqa____?", 0.f, -100.f, 3.f);
|
||||
JGL::RenderText("CHINESE CHARCTERS DONT WORK", 0.f, -100.f, 1.f);
|
||||
}
|
||||
|
||||
void OnRefresh(float elapsed) override
|
||||
|
@@ -41,7 +41,10 @@ namespace JGL
|
||||
FT_Face face;
|
||||
FT_Library ft;
|
||||
|
||||
using namespace J3ML;
|
||||
|
||||
bool InitTextEngine() {
|
||||
constexpr u32 default_font_size = 16;
|
||||
if (FT_Init_FreeType(&ft))
|
||||
{
|
||||
std::cout << "Error::FREETYPE: " << std::endl;
|
||||
@@ -53,7 +56,7 @@ namespace JGL
|
||||
std::cout << "Error::FREETYPE: Failed to load font!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
FT_Set_Pixel_Sizes(face, 0, 48);
|
||||
FT_Set_Pixel_Sizes(face, 0, default_font_size);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ namespace JGL
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, g->bitmap.width, g->bitmap.rows, 0, GL_RED, GL_UNSIGNED_BYTE, g->bitmap.buffer);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, g->bitmap.width, g->bitmap.rows, 0, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap.buffer);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
Reference in New Issue
Block a user