aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/Debug/05Font.exebin1213440 -> 1213440 bytes
-rw-r--r--build/libjin/libjin.vcxproj4
-rw-r--r--build/libjin/libjin.vcxproj.filters12
-rw-r--r--libjin/Graphics/Font/Decoder.cpp3
-rw-r--r--libjin/Graphics/Font/Decoder.h3
-rw-r--r--libjin/Graphics/Font/Font.h8
-rw-r--r--libjin/Graphics/Font/TTF.cpp4
-rw-r--r--libjin/Graphics/Font/TTF.h22
-rw-r--r--libjin/Graphics/Font/TexFont.cpp79
-rw-r--r--libjin/Graphics/Font/TexFont.h54
-rw-r--r--libjin/Graphics/Font/Text.cpp3
-rw-r--r--libjin/Graphics/Font/Text.h3
-rw-r--r--libjin/Graphics/Font/TextureFont.cpp65
-rw-r--r--libjin/Graphics/Font/TextureFont.h52
-rw-r--r--test/05Font/main.cpp2
-rw-r--r--test/06TextureFont/main.cpp149
16 files changed, 291 insertions, 172 deletions
diff --git a/build/Debug/05Font.exe b/build/Debug/05Font.exe
index 32d7eaa..25bb6d3 100644
--- a/build/Debug/05Font.exe
+++ b/build/Debug/05Font.exe
Binary files differ
diff --git a/build/libjin/libjin.vcxproj b/build/libjin/libjin.vcxproj
index 58b1371..c787847 100644
--- a/build/libjin/libjin.vcxproj
+++ b/build/libjin/libjin.vcxproj
@@ -37,7 +37,7 @@
<ClCompile Include="..\..\libjin\Graphics\Color.cpp" />
<ClCompile Include="..\..\libjin\Graphics\Drawable.cpp" />
<ClCompile Include="..\..\libjin\Graphics\Font\Decoder.cpp" />
- <ClCompile Include="..\..\libjin\Graphics\Font\TexFont.cpp" />
+ <ClCompile Include="..\..\libjin\Graphics\Font\TextureFont.cpp" />
<ClCompile Include="..\..\libjin\Graphics\Font\Text.cpp" />
<ClCompile Include="..\..\libjin\Graphics\Font\TTF.cpp" />
<ClCompile Include="..\..\libjin\Graphics\Image.cpp" />
@@ -94,7 +94,7 @@
<ClInclude Include="..\..\libjin\Graphics\Font\Decoder.h" />
<ClInclude Include="..\..\libjin\Graphics\Font\Font.h" />
<ClInclude Include="..\..\libjin\Graphics\Font\Page.h" />
- <ClInclude Include="..\..\libjin\Graphics\Font\TexFont.h" />
+ <ClInclude Include="..\..\libjin\Graphics\Font\TextureFont.h" />
<ClInclude Include="..\..\libjin\Graphics\Font\Text.h" />
<ClInclude Include="..\..\libjin\Graphics\Font\TTF.h" />
<ClInclude Include="..\..\libjin\Graphics\Image.h" />
diff --git a/build/libjin/libjin.vcxproj.filters b/build/libjin/libjin.vcxproj.filters
index f194817..3cb01fc 100644
--- a/build/libjin/libjin.vcxproj.filters
+++ b/build/libjin/libjin.vcxproj.filters
@@ -177,9 +177,6 @@
<ClCompile Include="..\..\libjin\Graphics\Sprite.cpp">
<Filter>Graphics</Filter>
</ClCompile>
- <ClCompile Include="..\..\libjin\Graphics\Font\TexFont.cpp">
- <Filter>Graphics\Font</Filter>
- </ClCompile>
<ClCompile Include="..\..\libjin\Graphics\Font\TTF.cpp">
<Filter>Graphics\Font</Filter>
</ClCompile>
@@ -192,6 +189,9 @@
<ClCompile Include="..\..\libjin\Graphics\Font\Text.cpp">
<Filter>Graphics\Font</Filter>
</ClCompile>
+ <ClCompile Include="..\..\libjin\Graphics\Font\TextureFont.cpp">
+ <Filter>Graphics\Font</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\libjin\3rdparty\GLee\GLee.h">
@@ -388,9 +388,6 @@
<ClInclude Include="..\..\libjin\Graphics\Font\Page.h">
<Filter>Graphics\Font</Filter>
</ClInclude>
- <ClInclude Include="..\..\libjin\Graphics\Font\TexFont.h">
- <Filter>Graphics\Font</Filter>
- </ClInclude>
<ClInclude Include="..\..\libjin\Graphics\Font\TTF.h">
<Filter>Graphics\Font</Filter>
</ClInclude>
@@ -403,6 +400,9 @@
<ClInclude Include="..\..\libjin\Graphics\Font\Text.h">
<Filter>Graphics\Font</Filter>
</ClInclude>
+ <ClInclude Include="..\..\libjin\Graphics\Font\TextureFont.h">
+ <Filter>Graphics\Font</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\libjin\README.md" />
diff --git a/libjin/Graphics/Font/Decoder.cpp b/libjin/Graphics/Font/Decoder.cpp
index 312e142..b3f2bb2 100644
--- a/libjin/Graphics/Font/Decoder.cpp
+++ b/libjin/Graphics/Font/Decoder.cpp
@@ -6,8 +6,6 @@ namespace jin
{
namespace graphics
{
-namespace unicode
-{
/* utf8 byte string to unicode codepoint */
static const char *utf8toCodepoint(const char *p, unsigned *res) {
@@ -73,6 +71,5 @@ namespace unicode
return nullptr;
}
-} // unicode
} // graphics
} // jin \ No newline at end of file
diff --git a/libjin/Graphics/Font/Decoder.h b/libjin/Graphics/Font/Decoder.h
index dcd2e56..83570e9 100644
--- a/libjin/Graphics/Font/Decoder.h
+++ b/libjin/Graphics/Font/Decoder.h
@@ -7,8 +7,6 @@ namespace jin
{
namespace graphics
{
-namespace unicode
-{
typedef unsigned int Codepoint;
@@ -51,7 +49,6 @@ namespace unicode
const void* next(const void* data) const override;
};
-} // unicode
} // graphics
} // jin
diff --git a/libjin/Graphics/Font/Font.h b/libjin/Graphics/Font/Font.h
index 1e5f884..424c324 100644
--- a/libjin/Graphics/Font/Font.h
+++ b/libjin/Graphics/Font/Font.h
@@ -16,12 +16,12 @@ namespace graphics
Font() {}
virtual ~Font() {};
- virtual Page* typeset(const unicode::Text& text, int lineheight, int spacing = 0) = 0;
- virtual Page* typeset(const unicode::Content& text, int lineheight, int spacing = 0) = 0;
+ virtual Page* typeset(const Text& text, int lineheight, int spacing = 0) = 0;
+ virtual Page* typeset(const Content& text, int lineheight, int spacing = 0) = 0;
virtual void print(const Page* page, int x, int y) = 0;
- virtual void print(const unicode::Content& text, int x, int y, int lineheight, int spacing = 0) = 0;
- virtual void print(const unicode::Text& text, int x, int y, int lineheight, int spacing = 0) = 0;
+ virtual void print(const Content& text, int x, int y, int lineheight, int spacing = 0) = 0;
+ virtual void print(const Text& text, int x, int y, int lineheight, int spacing = 0) = 0;
};
diff --git a/libjin/Graphics/Font/TTF.cpp b/libjin/Graphics/Font/TTF.cpp
index ea340e4..98e57dd 100644
--- a/libjin/Graphics/Font/TTF.cpp
+++ b/libjin/Graphics/Font/TTF.cpp
@@ -18,8 +18,6 @@ namespace jin
namespace graphics
{
- using namespace unicode;
-
///////////////////////////////////////////////////////////////////////////////////////////////
// TTFData
///////////////////////////////////////////////////////////////////////////////////////////////
@@ -321,7 +319,7 @@ namespace graphics
}
}
- void TTF::print(const unicode::Text& text, int x, int y, int lineheight, int spacing /* = 0 */)
+ void TTF::print(const Text& text, int x, int y, int lineheight, int spacing /* = 0 */)
{
print(*text, x, y, lineheight, spacing);
}
diff --git a/libjin/Graphics/Font/TTF.h b/libjin/Graphics/Font/TTF.h
index 59e8125..4f51138 100644
--- a/libjin/Graphics/Font/TTF.h
+++ b/libjin/Graphics/Font/TTF.h
@@ -64,11 +64,11 @@ namespace graphics
public:
static TTF* createTTF(TTFData* ttfData, unsigned int ttfSzie);
- Page* typeset(const unicode::Text& text, int lineheight, int spacing = 0) override;
- Page* typeset(const unicode::Content& text, int lineheight, int spacing = 0) override;
+ Page* typeset(const Text& text, int lineheight, int spacing = 0) override;
+ Page* typeset(const Content& text, int lineheight, int spacing = 0) override;
- void print(const unicode::Text& text, int x, int y, int lineheight, int spacing = 0) override;
- void print(const unicode::Content& text, int x, int y, int lineheight, int spacing = 0) override;
+ void print(const Text& text, int x, int y, int lineheight, int spacing = 0) override;
+ void print(const Content& text, int x, int y, int lineheight, int spacing = 0) override;
void print(const Page* page, int x, int y) override;
~TTF();
@@ -92,24 +92,24 @@ namespace graphics
static const int TEXTURE_WIDTHS[TEXTURE_SIZE_LEVELS_COUNT];
static const int TEXTURE_HEIGHTS[TEXTURE_SIZE_LEVELS_COUNT];
- TTF(TTFData* ttf, unicode::Codepoint ttfSize);
+ TTF(TTFData* ttf, Codepoint ttfSize);
void estimateSize();
GLuint createAtlas();
- TTFGlyph& bakeGlyph(unicode::Codepoint character);
- TTFGlyph& findGlyph(unicode::Codepoint character);
+ TTFGlyph& bakeGlyph(Codepoint character);
+ TTFGlyph& findGlyph(Codepoint character);
int getCharWidth(int c);
int getCharHeight(int c);
- int getTextWidth(const unicode::Content& text, int spacing = 0);
- int getTextHeight(const unicode::Content& text, int lineheight);
- void getTextBox(const unicode::Content& text, int* w, int* h, int lineheight, int spacing = 0);
+ int getTextWidth(const Content& text, int spacing = 0);
+ int getTextHeight(const Content& text, int lineheight);
+ void getTextBox(const Content& text, int* w, int* h, int lineheight, int spacing = 0);
int textureWidth;
int textureHeight;
std::vector<GLuint> atlases;
- std::map<unicode::Codepoint, TTFGlyph> glyphs;
+ std::map<Codepoint, TTFGlyph> glyphs;
TTFData* ttf;
const unsigned int ttfsize;
int baseline;
diff --git a/libjin/Graphics/Font/TexFont.cpp b/libjin/Graphics/Font/TexFont.cpp
deleted file mode 100644
index 990a1af..0000000
--- a/libjin/Graphics/Font/TexFont.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-#include "TexFont.h"
-
-namespace jin
-{
-namespace graphics
-{
-
- using namespace unicode;
-
- /*
- * +--------------------+
- * | top |
- * | l ************* r |
- * | e ************* i |
- * | f ****glyphs*** g |
- * | t ************* h |
- * | ************* t |
- * | bottom |
- * +--------------------+
- */
-
- /* create texture font from tilemap */
- TexFont * TexFont::createTexFont(const Bitmap* bitmap, const Content& codepoints, int cellw, int cellh)
- {
- TexFont* tf = new TexFont(bitmap, codepoints, cellw, cellh);
- return tf;
- }
-
- /* create texture font from seperated glyphs */
- TexFont* TexFont::createTexFont(const Bitmap* bitmap, const Content& codepoints, Color mask, int cellh)
- {
- TexFont* tf = new TexFont(bitmap, codepoints, mask, cellh);
- return tf;
- }
-
- TexFont::~TexFont()
- {
- }
-
- Page* TexFont::typeset(const Content& text, int lineheight, int spacing)
- {
- return nullptr;
- }
-
- Page* TexFont::typeset(const Text& text, int lineheight, int spacing)
- {
- return nullptr;
- }
-
- void TexFont::print(const Page* page, int x, int y)
- {
-
- }
-
- void TexFont::print(const Content& text, int x, int y, int linehgiht, int spacing)
- {
-
- }
-
- void TexFont::print(const Text& text, int x, int y, int lineheight, int spacing)
- {
-
- }
-
- TexFont::TexFont(const Bitmap* bitmap, const Content& codepoints, int cellw, int cellh)
- : Drawable(bitmap)
- {
- int l, r, t, b;
-
- }
-
- TexFont::TexFont(const Bitmap* bitmap, const Content& codepoints, Color mask, int cellh)
- : Drawable(bitmap)
- {
-
- }
-
-}
-} \ No newline at end of file
diff --git a/libjin/Graphics/Font/TexFont.h b/libjin/Graphics/Font/TexFont.h
deleted file mode 100644
index c1b2d18..0000000
--- a/libjin/Graphics/Font/TexFont.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef __LIBJIN_TEXTURE_FONT_H
-#define __LIBJIN_TEXTURE_FONT_H
-
-#include <map>
-#include <vector>
-
-#include "../../Math/Vector4.hpp"
-#include "../Drawable.h"
-#include "../Bitmap.h"
-
-#include "Page.h"
-#include "Font.h"
-#include "Text.h"
-
-namespace jin
-{
-namespace graphics
-{
-
- /* Texture font */
- class TexFont : public Font
- , public Drawable
- {
- public:
- /* create texture font from tilemap */
- static TexFont* createTexFont(const Bitmap* bitmap, const unicode::Content& codepoints, int cellw, int cellh);
- static TexFont* createTexFont(const Bitmap* bitmap, const unicode::Text& text, int cellw, int cellh);
- /* create texture font from seperated glyphs */
- static TexFont* createTexFont(const Bitmap* bitmap, const unicode::Content& codepoints, Color mask, int cellh);
- static TexFont* createTexFont(const Bitmap* bitmap, const unicode::Text& text, Color mask, int cellh);
-
- ~TexFont();
-
- Page* typeset(const unicode::Text& text, int lineheight, int spacing = 0) override;
- Page* typeset(const unicode::Content& text, int lineheight, int spacing = 0) override ;
-
- void print(const Page* page, int x, int y) override;
- void print(const unicode::Content& text, int x, int y, int linehgiht, int spacing = 0) override;
- void print(const unicode::Text& text, int x, int y, int lineheight, int spacing = 0)override;
-
- private:
- struct TexGlyph { unsigned short x, y, w, h;};
-
- TexFont(const Bitmap* bitmap, const unicode::Content& codepoints, int cellw, int cellh);
- TexFont(const Bitmap* bitmap, const unicode::Content& codepoints, Color mask, int cellh);
-
- std::map<unicode::Codepoint, TexGlyph> glyphs;
-
- };
-
-}
-}
-
-#endif \ No newline at end of file
diff --git a/libjin/Graphics/Font/Text.cpp b/libjin/Graphics/Font/Text.cpp
index 3ab7f07..b3ba473 100644
--- a/libjin/Graphics/Font/Text.cpp
+++ b/libjin/Graphics/Font/Text.cpp
@@ -4,8 +4,6 @@ namespace jin
{
namespace graphics
{
-namespace unicode
-{
/////////////////////////////////////////////////////////////////////////////
// iterator
@@ -133,6 +131,5 @@ namespace unicode
return content;
}
-} // unicode
} // graphics
} // jin \ No newline at end of file
diff --git a/libjin/Graphics/Font/Text.h b/libjin/Graphics/Font/Text.h
index c2cc64b..d092d41 100644
--- a/libjin/Graphics/Font/Text.h
+++ b/libjin/Graphics/Font/Text.h
@@ -7,8 +7,6 @@ namespace jin
{
namespace graphics
{
-namespace unicode
-{
class Text;
@@ -57,7 +55,6 @@ namespace unicode
};
-} // unicode
} // graphics
} // jin
diff --git a/libjin/Graphics/Font/TextureFont.cpp b/libjin/Graphics/Font/TextureFont.cpp
new file mode 100644
index 0000000..89600c7
--- /dev/null
+++ b/libjin/Graphics/Font/TextureFont.cpp
@@ -0,0 +1,65 @@
+#include "TextureFont.h"
+
+namespace jin
+{
+namespace graphics
+{
+
+ /* create texture font from tilemap */
+ TextureFont * TextureFont::createTextureFont(const Bitmap* bitmap, const Content& codepoints, int cellw, int cellh)
+ {
+ TextureFont* tf = new TextureFont(bitmap, codepoints, cellw, cellh);
+ return tf;
+ }
+
+ /* create texture font from seperated glyphs */
+ TextureFont* TextureFont::createTextureFont(const Bitmap* bitmap, const Content& codepoints, Color mask, int cellh)
+ {
+ TextureFont* tf = new TextureFont(bitmap, codepoints, mask, cellh);
+ return tf;
+ }
+
+ TextureFont::~TextureFont()
+ {
+ }
+
+ Page* TextureFont::typeset(const Content& text, int lineheight, int spacing)
+ {
+
+ return nullptr;
+ }
+
+ Page* TextureFont::typeset(const Text& text, int lineheight, int spacing)
+ {
+ return nullptr;
+ }
+
+ void TextureFont::print(const Page* page, int x, int y)
+ {
+
+ }
+
+ void TextureFont::print(const Content& text, int x, int y, int linehgiht, int spacing)
+ {
+
+ }
+
+ void TextureFont::print(const Text& text, int x, int y, int lineheight, int spacing)
+ {
+
+ }
+
+ TextureFont::TextureFont(const Bitmap* bitmap, const Content& codepoints, int cellw, int cellh)
+ : Drawable(bitmap)
+ {
+ int l, r, t, b;
+
+ }
+
+ TextureFont::TextureFont(const Bitmap* bitmap, const Content& codepoints, Color mask, int cellh)
+ : Drawable(bitmap)
+ {
+ }
+
+}
+} \ No newline at end of file
diff --git a/libjin/Graphics/Font/TextureFont.h b/libjin/Graphics/Font/TextureFont.h
new file mode 100644
index 0000000..243c9d5
--- /dev/null
+++ b/libjin/Graphics/Font/TextureFont.h
@@ -0,0 +1,52 @@
+#ifndef __LIBJIN_TEXTURE_FONT_H
+#define __LIBJIN_TEXTURE_FONT_H
+
+#include <map>
+#include <vector>
+
+#include "../../Math/Vector4.hpp"
+#include "../Drawable.h"
+#include "../Bitmap.h"
+
+#include "Page.h"
+#include "Font.h"
+#include "Text.h"
+
+namespace jin
+{
+namespace graphics
+{
+
+ /* Texture font */
+ class TextureFont : public Font
+ , public Drawable
+ {
+ public:
+ static TextureFont* createTextureFont(const Bitmap* bitmap, const Content& codepoints, int cellw, int cellh);
+ static TextureFont* createTextureFont(const Bitmap* bitmap, const Text& text, int cellw, int cellh);
+ static TextureFont* createTextureFont(const Bitmap* bitmap, const Content& codepoints, Color mask, int cellh);
+ static TextureFont* createTextureFont(const Bitmap* bitmap, const Text& text, Color mask, int cellh);
+
+ ~TextureFont();
+
+ Page* typeset(const Text& text, int lineheight, int spacing = 0) override;
+ Page* typeset(const Content& text, int lineheight, int spacing = 0) override ;
+
+ void print(const Page* page, int x, int y) override;
+ void print(const Content& text, int x, int y, int linehgiht, int spacing = 0) override;
+ void print(const Text& text, int x, int y, int lineheight, int spacing = 0)override;
+
+ private:
+ struct TextureGlyph { unsigned short x, y, w, h;};
+
+ TextureFont(const Bitmap* bitmap, const Content& codepoints, int cellw, int cellh);
+ TextureFont(const Bitmap* bitmap, const Content& codepoints, Color mask, int cellh);
+
+ std::map<Codepoint, TextureGlyph> glyphs;
+
+ };
+
+}
+}
+
+#endif \ No newline at end of file
diff --git a/test/05Font/main.cpp b/test/05Font/main.cpp
index 6eebe04..9d44f2f 100644
--- a/test/05Font/main.cpp
+++ b/test/05Font/main.cpp
@@ -68,7 +68,7 @@ Color frag(Color col, Texture tex, Vertex v)
font = TTF::createTTF(data, 15);
const char* str = u8R"(源氏物语げんじものがたり)";
int l = strlen(str);
- page = font->typeset(unicode::Text(unicode::Encode::UTF8, str, strlen(str)), 15, 0);
+ page = font->typeset(Text(Encode::UTF8, str, strlen(str)), 15, 0);
delete data;
//canvas = Canvas::createCanvas(100, 100);
//page = font->typeset("こんにちは世界!", 120, 20);
diff --git a/test/06TextureFont/main.cpp b/test/06TextureFont/main.cpp
index b28b04f..9551604 100644
--- a/test/06TextureFont/main.cpp
+++ b/test/06TextureFont/main.cpp
@@ -1,3 +1,152 @@
+#include <iostream>
+#include "jin.h"
+using namespace jin::core;
+using namespace jin::graphics;
+using namespace jin::input;
+using namespace jin::audio;
+using namespace jin::filesystem;
+Font* font = nullptr;
+Canvas* canvas;
+TTFData* data = nullptr;
+Shader* shader = nullptr;
+Shader* shader2 = nullptr;
+Page* page = nullptr;
+Texture* tex = nullptr;
+float dt;
+void onLoad()
+{
+ const char* font_shader = R"(
+#VERTEX_SHADER
+Vertex vert(Vertex v)
+{
+ return v;
+}
+
+#END_VERTEX_SHADER
+
+#FRAGMENT_SHADER
+
+Color frag(Color col, Texture tex, Vertex v)
+{
+ return vec4(col.rgb, texel(tex, v.uv).a);
+}
+
+#END_FRAGMENT_SHADER
+ )";
+ const char* canvas_shader = R"(
+#VERTEX_SHADER
+
+Vertex vert(Vertex v)
+{
+ return v;
+}
+
+#END_VERTEX_SHADER
+
+#FRAGMENT_SHADER
+
+Color frag(Color col, Texture tex, Vertex v)
+{
+ if(v.uv.x <= 0.002f || v.uv.x >= 0.998f || v.uv.y <= 0.005f || v.uv.y >= 0.995f)
+ return vec4(1, 1, 1, 1);
+ else
+ return texel(tex, v.uv);
+}
+
+#END_FRAGMENT_SHADER
+)";
+ shader = Shader::createShader(font_shader);
+ shader2 = Shader::createShader(canvas_shader);
+ Filesystem* fs = Filesystem::get();
+ fs->mount("../Debug");
+ Buffer buffer;
+ fs->read("font.ttf", &buffer);
+ data = TTFData::createTTFData((const unsigned char*)buffer.data, buffer.size);
+ font = TTF::createTTF(data, 15);
+ const char* str = u8R"(Դ爐󤸤Τ)";
+ int l = strlen(str);
+ Text text = Text(Encode::UTF8, str, strlen(str));
+ page = font->typeset(text, 15, 0);
+ delete data;
+ //canvas = Canvas::createCanvas(100, 100);
+ //page = font->typeset("ˤ!", 120, 20);
+ buffer.clear();
+ fs->read("img.png", &buffer);
+ Bitmap* bitmap = Bitmap::createBitmap(buffer.data, buffer.size);
+ tex = Texture::createTexture(bitmap);
+ canvas = Canvas::createCanvas(page->size.w, page->size.h);
+
+ Canvas::bind(canvas);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glColor4f(1, 1, 1, 1);
+ if (font != nullptr)
+ {
+ //font->print(u8"Hello,\n world!", 10, 10);
+ //font->print(u8"ڧӧ֧ ާڧ!", 10, 10 + 15 * 1);
+ shader->use();
+ font->print(page, 0, 0);
+ shader->unuse();
+ //font->print(u8"!", 10, 10 + 15*3);
+ //font->render(page);
+ }
+ Canvas::unbind();
+}
+
+void onEvent(jin::input::Event* e)
+{
+ static Game* game = Game::get();
+ if (e->type == EventType::QUIT)
+ game->stop();
+}
+
+void onUpdate(int ms)
+{
+ dt += ms / (float)1000;
+}
+
+void onDraw()
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glColor4f(1, 1, 1, 1);
+ //gl.pushColor(32, 32, 32, 255);
+ //rect(FILL, 0, 0, 500, 500);
+ //circle(RenderMode::LINE, 50, 50, 30);
+ //tex->draw(0, 0, 1, 1, 0);
+ //tex->draw(20, 50, 1, 1, 0);
+ //shader->sendFloat("dt", dt);
+ shader2->use();
+ canvas->draw(20 * sin(dt), 10 * cos(dt), 1, 1, 0);
+ shader2->unuse();
+}
+
+int main(int argc, char* argv[])
+{
+ Game* game = Game::get();
+ Game::Setting setting;
+ setting.loader = onLoad;
+ setting.eventHandler = onEvent;
+ setting.updater = onUpdate;
+ setting.drawer = onDraw;
+ game->init(&setting);
+
+ Window* wnd = Window::get();
+ Window::Setting wndSetting;
+ wndSetting.width = 600;
+ wndSetting.height = 512;
+ wndSetting.title = "Jin v0.1.1";
+ wndSetting.fps = 60;
+ wndSetting.vsync = false;
+ wndSetting.fullscreen = false;
+ wndSetting.resizable = false;
+ wnd->init(&wndSetting);
+
+ game->run();
+
+ game->quit();
+ wnd->quit();
+
+ return 0;
+} \ No newline at end of file