aboutsummaryrefslogtreecommitdiff
path: root/src/libjin
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-09-03 09:31:26 +0800
committerchai <chaifix@163.com>2018-09-03 09:31:26 +0800
commit3c74f0147d2e2e12ad5a163d3ed1a1e8dab76743 (patch)
treee2ca3a3876fdcc63e89df186a25285e7281c5a5e /src/libjin
parent05d1cfb909390de4843ac6932be14520b80c1bcd (diff)
*update
Diffstat (limited to 'src/libjin')
-rw-r--r--src/libjin/Graphics/Font.h10
-rw-r--r--src/libjin/Graphics/Shapes.cpp8
-rw-r--r--src/libjin/Graphics/Shapes.h10
3 files changed, 11 insertions, 17 deletions
diff --git a/src/libjin/Graphics/Font.h b/src/libjin/Graphics/Font.h
index 176669c..5311c96 100644
--- a/src/libjin/Graphics/Font.h
+++ b/src/libjin/Graphics/Font.h
@@ -11,11 +11,7 @@ namespace jin
{
namespace graphics
{
- /**
- * Usage of stb_truetype.h here might be a little
- * bit dummy. Implementation of Font is referring
- * to stb_truetype.h L243~284. I basicly copy it:)
- */
+
class Font: public Drawable
{
public:
@@ -34,9 +30,7 @@ namespace graphics
void box(const char* text, int fontHeight, int spacing, int lineHeight, int* w, int * h);
private:
- /**
- * ASCII 32(space)..126(~) 95 glyphs
- */
+ /* ASCII 32(space)..126(~) 95 glyphs */
static const int ASCII_CHARACTER_NUM = 96;
stbtt_bakedchar asciiData[ASCII_CHARACTER_NUM];
diff --git a/src/libjin/Graphics/Shapes.cpp b/src/libjin/Graphics/Shapes.cpp
index aef4a1c..b2ef3f8 100644
--- a/src/libjin/Graphics/Shapes.cpp
+++ b/src/libjin/Graphics/Shapes.cpp
@@ -44,7 +44,7 @@ namespace graphics
glDisableClientState(GL_VERTEX_ARRAY);
}
- void circle(RENDER_MODE mode, int x, int y, int r)
+ void circle(RenderMode mode, int x, int y, int r)
{
r = r < 0 ? 0 : r;
@@ -69,13 +69,13 @@ namespace graphics
delete[] coords;
}
- void rect(RENDER_MODE mode, int x, int y, int w, int h)
+ void rect(RenderMode mode, int x, int y, int w, int h)
{
float coords[] = { x, y, x + w, y, x + w, y + h, x, y + h };
polygon(mode, coords, 4);
}
- void triangle(RENDER_MODE mode, int x1, int y1, int x2, int y2, int x3, int y3)
+ void triangle(RenderMode mode, int x1, int y1, int x2, int y2, int x3, int y3)
{
float coords[] = { x1, y1, x2, y2, x3, y3 };
polygon(mode, coords, 3);
@@ -101,7 +101,7 @@ namespace graphics
delete[] verts;
}
- void polygon(RENDER_MODE mode, float* p, int count)
+ void polygon(RenderMode mode, float* p, int count)
{
if (mode == LINE)
{
diff --git a/src/libjin/Graphics/Shapes.h b/src/libjin/Graphics/Shapes.h
index 1ef93a1..204339f 100644
--- a/src/libjin/Graphics/Shapes.h
+++ b/src/libjin/Graphics/Shapes.h
@@ -16,19 +16,19 @@ namespace graphics
NONE = 0,
FILL ,
LINE
- }RENDER_MODE;
+ }RenderMode;
/**
* TODO:
* drawPixels(int n, points)
*/
extern void line(int x1, int y1, int x2, int y2);
- extern void rect(RENDER_MODE mode, int x, int y, int w, int h);
- extern void triangle(RENDER_MODE mode, int x1, int y1, int x2, int y2, int x3, int y3);
- extern void circle(RENDER_MODE mode, int x, int y, int r);
+ extern void rect(RenderMode mode, int x, int y, int w, int h);
+ extern void triangle(RenderMode mode, int x1, int y1, int x2, int y2, int x3, int y3);
+ extern void circle(RenderMode mode, int x, int y, int r);
extern void point(int x, int y);
extern void points(int n, GLshort* p, GLubyte* c);
- extern void polygon(RENDER_MODE mode, float* p, int count);
+ extern void polygon(RenderMode mode, float* p, int count);
} // graphics
} // jin