diff --git a/engine/annotated.html b/engine/annotated.html index bb35870..4fed5ae 100644 --- a/engine/annotated.html +++ b/engine/annotated.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/audio_8h.html b/engine/audio_8h.html index dfeb7c0..d48ea72 100644 --- a/engine/audio_8h.html +++ b/engine/audio_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/audio_8h_source.html b/engine/audio_8h_source.html index c44a0d4..36c4d8a 100644 --- a/engine/audio_8h_source.html +++ b/engine/audio_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/classes.html b/engine/classes.html index 348eb53..ec9a076 100644 --- a/engine/classes.html +++ b/engine/classes.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/client_8h.html b/engine/client_8h.html index 4596b0e..81f3e64 100644 --- a/engine/client_8h.html +++ b/engine/client_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/client_8h_source.html b/engine/client_8h_source.html index b88cb9e..a33882e 100644 --- a/engine/client_8h_source.html +++ b/engine/client_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/compat_8h.html b/engine/compat_8h.html index ecb8d75..982431b 100644 --- a/engine/compat_8h.html +++ b/engine/compat_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/compat_8h_source.html b/engine/compat_8h_source.html index 10bf2ef..30dbe1d 100644 --- a/engine/compat_8h_source.html +++ b/engine/compat_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/core_8h.html b/engine/core_8h.html index d2139c0..e2f2279 100644 --- a/engine/core_8h.html +++ b/engine/core_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/core_8h_source.html b/engine/core_8h_source.html index 803b593..7ee763b 100644 --- a/engine/core_8h_source.html +++ b/engine/core_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_0d98df33664112e13024255ca1b098d2.html b/engine/dir_0d98df33664112e13024255ca1b098d2.html index c9712d1..183dfaa 100644 --- a/engine/dir_0d98df33664112e13024255ca1b098d2.html +++ b/engine/dir_0d98df33664112e13024255ca1b098d2.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_1d6203c8371f8f7ecbd9e9230894d473.html b/engine/dir_1d6203c8371f8f7ecbd9e9230894d473.html index 1f23033..b271e02 100644 --- a/engine/dir_1d6203c8371f8f7ecbd9e9230894d473.html +++ b/engine/dir_1d6203c8371f8f7ecbd9e9230894d473.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_22f649445e791bda7c2b14c78388b946.html b/engine/dir_22f649445e791bda7c2b14c78388b946.html index fd2b798..5f4d363 100644 --- a/engine/dir_22f649445e791bda7c2b14c78388b946.html +++ b/engine/dir_22f649445e791bda7c2b14c78388b946.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_23ec12649285f9fabf3a6b7380226c28.html b/engine/dir_23ec12649285f9fabf3a6b7380226c28.html deleted file mode 100644 index f8171d9..0000000 --- a/engine/dir_23ec12649285f9fabf3a6b7380226c28.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - -GoldFish Engine: util Directory Reference - - - - - - - - - - - - - -
-
- - - - - - -
-
GoldFish Engine -
-
Quite simple and lightweight game engine
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
util Directory Reference
-
-
- - - - -

-Directories

 engineinfo
 
-
-
- - - - diff --git a/engine/dir_23ec12649285f9fabf3a6b7380226c28.js b/engine/dir_23ec12649285f9fabf3a6b7380226c28.js deleted file mode 100644 index 30e1afa..0000000 --- a/engine/dir_23ec12649285f9fabf3a6b7380226c28.js +++ /dev/null @@ -1,4 +0,0 @@ -var dir_23ec12649285f9fabf3a6b7380226c28 = -[ - [ "engineinfo", "dir_564eac3fbd1641f0d7f53b584187d9ce.html", "dir_564eac3fbd1641f0d7f53b584187d9ce" ] -]; \ No newline at end of file diff --git a/engine/dir_546733639134b9431ef34ac72f6d1288.html b/engine/dir_546733639134b9431ef34ac72f6d1288.html index 4b59f70..0e239f7 100644 --- a/engine/dir_546733639134b9431ef34ac72f6d1288.html +++ b/engine/dir_546733639134b9431ef34ac72f6d1288.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_564eac3fbd1641f0d7f53b584187d9ce.html b/engine/dir_564eac3fbd1641f0d7f53b584187d9ce.html deleted file mode 100644 index 1f2bfb2..0000000 --- a/engine/dir_564eac3fbd1641f0d7f53b584187d9ce.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - -GoldFish Engine: util/engineinfo Directory Reference - - - - - - - - - - - - - -
-
- - - - - - -
-
GoldFish Engine -
-
Quite simple and lightweight game engine
-
-
- - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
engineinfo Directory Reference
-
-
- - - - - - -

-Files

 main_console.c
 
 main_windows.c
 
-
-
- - - - diff --git a/engine/dir_564eac3fbd1641f0d7f53b584187d9ce.js b/engine/dir_564eac3fbd1641f0d7f53b584187d9ce.js deleted file mode 100644 index 5979b4a..0000000 --- a/engine/dir_564eac3fbd1641f0d7f53b584187d9ce.js +++ /dev/null @@ -1,5 +0,0 @@ -var dir_564eac3fbd1641f0d7f53b584187d9ce = -[ - [ "main_console.c", "main__console_8c_source.html", null ], - [ "main_windows.c", "main__windows_8c_source.html", null ] -]; \ No newline at end of file diff --git a/engine/dir_599f4bc7262791fc6e619beabec41e32.html b/engine/dir_599f4bc7262791fc6e619beabec41e32.html index 297f882..834f39c 100644 --- a/engine/dir_599f4bc7262791fc6e619beabec41e32.html +++ b/engine/dir_599f4bc7262791fc6e619beabec41e32.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_6684fa0b48800166488fdb25c8e1a946.html b/engine/dir_6684fa0b48800166488fdb25c8e1a946.html index 014af1a..c2364d7 100644 --- a/engine/dir_6684fa0b48800166488fdb25c8e1a946.html +++ b/engine/dir_6684fa0b48800166488fdb25c8e1a946.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/engine/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 1e7cd38..042f72e 100644 --- a/engine/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/engine/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_a63dedf81f1e5ea1d42bb45ef831eb8c.html b/engine/dir_a63dedf81f1e5ea1d42bb45ef831eb8c.html index d140864..ab2a0de 100644 --- a/engine/dir_a63dedf81f1e5ea1d42bb45ef831eb8c.html +++ b/engine/dir_a63dedf81f1e5ea1d42bb45ef831eb8c.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_a9b34658e7907785f8479c4760b6a49c.html b/engine/dir_a9b34658e7907785f8479c4760b6a49c.html index 5676555..96c5b83 100644 --- a/engine/dir_a9b34658e7907785f8479c4760b6a49c.html +++ b/engine/dir_a9b34658e7907785f8479c4760b6a49c.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_bc7c5e3621ab9884d751175cdc8197d4.html b/engine/dir_bc7c5e3621ab9884d751175cdc8197d4.html index c1c9cd2..b276407 100644 --- a/engine/dir_bc7c5e3621ab9884d751175cdc8197d4.html +++ b/engine/dir_bc7c5e3621ab9884d751175cdc8197d4.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_bfedb72b9d87795234454f6223b9ab1e.html b/engine/dir_bfedb72b9d87795234454f6223b9ab1e.html index 5927506..fbcdc29 100644 --- a/engine/dir_bfedb72b9d87795234454f6223b9ab1e.html +++ b/engine/dir_bfedb72b9d87795234454f6223b9ab1e.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_d44c64559bbebec7f509842c48db8b23.html b/engine/dir_d44c64559bbebec7f509842c48db8b23.html index d05bc37..6322bca 100644 --- a/engine/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/engine/dir_d44c64559bbebec7f509842c48db8b23.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_e60f2706c8c207c5a951446d03370319.html b/engine/dir_e60f2706c8c207c5a951446d03370319.html index ed0ab96..c6f138f 100644 --- a/engine/dir_e60f2706c8c207c5a951446d03370319.html +++ b/engine/dir_e60f2706c8c207c5a951446d03370319.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/dir_f3b487f46217856a45feb38703b75f99.html b/engine/dir_f3b487f46217856a45feb38703b75f99.html index 60ac6d0..b5159de 100644 --- a/engine/dir_f3b487f46217856a45feb38703b75f99.html +++ b/engine/dir_f3b487f46217856a45feb38703b75f99.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/directx_2dx11_2gf__draw_8c_source.html b/engine/directx_2dx11_2gf__draw_8c_source.html index 18577f7..12b7439 100644 --- a/engine/directx_2dx11_2gf__draw_8c_source.html +++ b/engine/directx_2dx11_2gf__draw_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -120,8 +121,8 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
20#include <string.h>
21#include <stdlib.h>
22
- - +
23void gf_draw_platform_begin(void) {}
+
24void gf_draw_platform_end(void) {}
25
26LRESULT CALLBACK gf_draw_platform_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
27 PAINTSTRUCT ps;
@@ -139,7 +140,7 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
39 draw->y = rect.top;
40 draw->width = rect.right - rect.left;
41 draw->height = rect.bottom - rect.top;
-
42 gf_draw_reshape(draw);
+
42 gf_draw_reshape(draw);
43 }
44 break;
45 case WM_MOUSEMOVE:
@@ -196,10 +197,10 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
96 return 0;
97}
98
-
99int gf_draw_platform_has_extension(gf_draw_t* draw, const char* query) { return 0; }
+
99int gf_draw_platform_has_extension(gf_draw_t* draw, const char* query) { return 0; }
100
- +
101int gf_draw_platform_step(gf_draw_t* draw) {
102 MSG msg;
103 int ret = 0;
104 while(PeekMessage(&msg, draw->platform->window, 0, 0, PM_NOREMOVE)) {
@@ -212,9 +213,9 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
111 }
112 }
113 if(ret == 0) {
- -
115 gf_draw_frame(draw);
- +
114 gf_draw_driver_before(draw);
+
115 gf_draw_frame(draw);
+
116 gf_draw_driver_after(draw);
117
118 SwapBuffers(draw->platform->dc);
119 }
@@ -223,7 +224,7 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
122
- +
123gf_draw_platform_t* gf_draw_platform_create(gf_engine_t* engine, gf_draw_t* draw) {
124 WNDCLASSEX wc;
125 RECT rect;
126 DWORD style;
@@ -234,7 +235,7 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
131 platform->instance = (HINSTANCE)GetModuleHandle(NULL);
132 if(platform->instance == NULL) {
133 gf_log_function(engine, "Failed to get instance", "");
-
134 gf_draw_platform_destroy(platform);
+
134 gf_draw_platform_destroy(platform);
135 return NULL;
136 }
137
@@ -252,14 +253,14 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
149 wc.hIconSm = LoadIcon(platform->instance, "GAME");
150 if(!RegisterClassEx(&wc)) {
151 gf_log_function(engine, "Failed to register class", "");
-
152 gf_draw_platform_destroy(platform);
+
152 gf_draw_platform_destroy(platform);
153 return NULL;
154 }
155
156 platform->window = CreateWindow("goldfish", draw->title, (WS_OVERLAPPEDWINDOW), draw->x, draw->y, draw->width, draw->height, NULL, 0, platform->instance, NULL);
157 if(platform->window == NULL) {
158 gf_log_function(engine, "Failed to create window", "");
-
159 gf_draw_platform_destroy(platform);
+
159 gf_draw_platform_destroy(platform);
160 return NULL;
161 }
162
@@ -281,7 +282,7 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
178
- +
179void gf_draw_platform_destroy(gf_draw_platform_t* platform) {
180 if(platform->dc != NULL) {
181 ReleaseDC(platform->window, platform->dc);
182 }
@@ -294,18 +295,8 @@ $(document).ready(function(){initNavTree('directx_2dx11_2gf__draw_8c_source.html
DirectX headers.
Drawing interface.
-
void gf_draw_frame(gf_draw_t *draw)
Draw frame (common part)
-
void gf_draw_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
Drawing driver.
-
void gf_draw_driver_before(gf_draw_t *draw)
Called before gf_draw_frame.
Definition gf_driver.c:61
-
void gf_draw_driver_after(gf_draw_t *draw)
Called after gf_draw_frame.
Definition gf_driver.c:71
Platform-dependent part of drawing driver.
-
void gf_draw_platform_destroy(gf_draw_platform_t *platform)
Destroy platform-dependent part of drawing driver.
Definition gf_draw.c:179
-
int gf_draw_platform_has_extension(gf_draw_t *draw, const char *query)
Check if renderer has extension.
Definition gf_draw.c:99
-
void gf_draw_platform_begin(void)
Initialize platform-dependent part of drawing driver.
Definition gf_draw.c:23
-
void gf_draw_platform_end(void)
Cleanup platform-dependent part of drawing driver.
Definition gf_draw.c:24
-
gf_draw_platform_t * gf_draw_platform_create(gf_engine_t *engine, gf_draw_t *draw)
Create platform-dependent part of drawing driver.
Definition gf_draw.c:123
-
int gf_draw_platform_step(gf_draw_t *draw)
Do platform-dependent step.
Definition gf_draw.c:101
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
diff --git a/engine/directx_2gf__driver_8c_source.html b/engine/directx_2gf__driver_8c_source.html index 7c145b6..36c6cb2 100644 --- a/engine/directx_2gf__driver_8c_source.html +++ b/engine/directx_2gf__driver_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -123,21 +124,21 @@ $(document).ready(function(){initNavTree('directx_2gf__driver_8c_source.html',''
23#include <string.h>
24
-
25gf_draw_driver_texture_t* gf_draw_driver_register_texture(gf_draw_t* draw, int width, int height, int* iwidth, int* iheight, unsigned char* data) {
+
25gf_draw_driver_texture_t* gf_draw_driver_register_texture(gf_draw_t* draw, int width, int height, int* iwidth, int* iheight, unsigned char* data) {
26 /* TODO: Implement this */
27 return NULL;
28}
29
- +
30void gf_draw_driver_destroy_texture(gf_draw_driver_texture_t* t) {
31 /* TODO: Implement this */
32 free(t);
33}
34
- +
35gf_draw_driver_t* gf_draw_driver_create(gf_engine_t* engine, gf_draw_t* draw) {
36 gf_draw_driver_t* draw_driver = malloc(sizeof(*draw_driver));
37 memset(draw_driver, 0, sizeof(*draw_driver));
38 draw_driver->engine = engine;
@@ -148,18 +149,18 @@ $(document).ready(function(){initNavTree('directx_2gf__driver_8c_source.html',''
43}
44
-
45int gf_draw_driver_has_extension(gf_draw_t* draw, const char* query) { return 0; }
+
45int gf_draw_driver_has_extension(gf_draw_t* draw, const char* query) { return 0; }
46
-
47void gf_draw_driver_reshape(gf_draw_t* draw) { /* TODO: Implement this */ }
+
47void gf_draw_driver_reshape(gf_draw_t* draw) { /* TODO: Implement this */ }
48
-
49void gf_draw_driver_begin_texture_2d(gf_draw_t* draw, gf_texture_t* texture) { /* TODO: Implement this */ }
+
49void gf_draw_driver_begin_texture_2d(gf_draw_t* draw, gf_texture_t* texture) { /* TODO: Implement this */ }
50
-
51void gf_draw_driver_end_texture_2d(gf_draw_t* draw) { /* TODO: Implement this */ }
+
51void gf_draw_driver_end_texture_2d(gf_draw_t* draw) { /* TODO: Implement this */ }
52
-
53void gf_draw_driver_set_color(gf_draw_t* draw, gf_graphic_color_t color) { /* TODO: Implement this */ }
+
53void gf_draw_driver_set_color(gf_draw_t* draw, gf_graphic_color_t color) { /* TODO: Implement this */ }
54
- +
55void gf_draw_driver_destroy(gf_draw_driver_t* driver) {
56 /* TODO: Implement this */
57 gf_log_function(driver->engine, "Destroyed drawing driver", "");
58 free(driver);
@@ -167,36 +168,23 @@ $(document).ready(function(){initNavTree('directx_2gf__driver_8c_source.html',''
60
- +
61void gf_draw_driver_before(gf_draw_t* draw) {
62 /* TODO: Remove if needed, needed at least for OpenGL */
- +
63 gf_draw_driver_reshape(draw);
64
65 /* TODO: Remove if needed, needed at least for OpenGL */
- +
66 gf_graphic_set_camera(draw);
67
-
68 gf_graphic_clear(draw);
+
68 gf_graphic_clear(draw);
69}
70
- +
71void gf_draw_driver_after(gf_draw_t* draw) {}
DirectX headers.
Drawing interface.
Drawing driver.
-
gf_draw_driver_texture_t * gf_draw_driver_register_texture(gf_draw_t *draw, int width, int height, int *iwidth, int *iheight, unsigned char *data)
Register driver-dependent texture.
Definition gf_driver.c:25
-
void gf_draw_driver_set_color(gf_draw_t *draw, gf_graphic_color_t color)
Set color.
Definition gf_driver.c:53
-
void gf_draw_driver_end_texture_2d(gf_draw_t *draw)
End 2D texture mode.
Definition gf_driver.c:51
-
void gf_draw_driver_before(gf_draw_t *draw)
Called before gf_draw_frame.
Definition gf_driver.c:61
-
void gf_draw_driver_after(gf_draw_t *draw)
Called after gf_draw_frame.
Definition gf_driver.c:71
-
int gf_draw_driver_has_extension(gf_draw_t *draw, const char *query)
Check if renderer has extension.
Definition gf_driver.c:45
-
void gf_draw_driver_destroy_texture(gf_draw_driver_texture_t *texture)
Destroy driver-dependent texture.
Definition gf_driver.c:30
-
void gf_draw_driver_begin_texture_2d(gf_draw_t *draw, gf_texture_t *texture)
Begin 2D texture mode.
Definition gf_driver.c:49
-
gf_draw_driver_t * gf_draw_driver_create(gf_engine_t *engine, gf_draw_t *draw)
Initialize drawing driver.
Definition gf_driver.c:35
-
void gf_draw_driver_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
Definition gf_driver.c:47
-
void gf_draw_driver_destroy(gf_draw_driver_t *driver)
Destroy drawing driver.
Definition gf_driver.c:55
Platform-dependent part of drawing driver.
Graphic interface.
-
void gf_graphic_clear(gf_draw_t *draw)
Clear the screen.
Definition gf_graphic.c:26
-
void gf_graphic_set_camera(gf_draw_t *draw)
Set camera.
Definition gf_graphic.c:34
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
diff --git a/engine/directx_2gf__graphic_8c_source.html b/engine/directx_2gf__graphic_8c_source.html index 74f0f4c..4ab9abd 100644 --- a/engine/directx_2gf__graphic_8c_source.html +++ b/engine/directx_2gf__graphic_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -119,30 +120,23 @@ $(document).ready(function(){initNavTree('directx_2gf__graphic_8c_source.html','
19#include <stdarg.h>
20#include <stdio.h>
21
-
22void gf_graphic_begin_2d(gf_draw_t* draw) { /* TODO: Implement this */ }
+
22void gf_graphic_begin_2d(gf_draw_t* draw) { /* TODO: Implement this */ }
23
-
24void gf_graphic_end_2d(gf_draw_t* draw) { /* TODO: Implement this */ }
+
24void gf_graphic_end_2d(gf_draw_t* draw) { /* TODO: Implement this */ }
25
-
26void gf_graphic_clear(gf_draw_t* draw) { /* TODO: Implement this */ }
+
26void gf_graphic_clear(gf_draw_t* draw) { /* TODO: Implement this */ }
27
-
28void gf_graphic_draw_texture_polygon(gf_draw_t* draw, gf_texture_t* texture, gf_graphic_color_t color, int dim, int npair, ...) { /* TODO: Implement this */ }
+
28void gf_graphic_draw_texture_polygon(gf_draw_t* draw, gf_texture_t* texture, gf_graphic_color_t color, int dim, int npair, ...) { /* TODO: Implement this */ }
29
-
30void gf_graphic_fill_polygon(gf_draw_t* draw, gf_graphic_color_t color, int dim, int npair, ...) { /* TODO: Implement this */ }
+
30void gf_graphic_fill_polygon(gf_draw_t* draw, gf_graphic_color_t color, int dim, int npair, ...) { /* TODO: Implement this */ }
31
-
32void gf_graphic_perspective(gf_draw_t* draw, double fovy, double znear, double zfar) { /* TODO: Implement this */ }
+
32void gf_graphic_perspective(gf_draw_t* draw, double fovy, double znear, double zfar) { /* TODO: Implement this */ }
33
-
34GF_EXPORT void gf_graphic_set_camera(gf_draw_t* draw) { /* TODO: Implement this */ }
+
34GF_EXPORT void gf_graphic_set_camera(gf_draw_t* draw) { /* TODO: Implement this */ }
DirectX headers.
Drawing interface.
Drawing driver.
Graphic interface.
-
void gf_graphic_draw_texture_polygon(gf_draw_t *draw, gf_texture_t *texture, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon with texture.
Definition gf_graphic.c:28
-
void gf_graphic_clear(gf_draw_t *draw)
Clear the screen.
Definition gf_graphic.c:26
-
void gf_graphic_fill_polygon(gf_draw_t *draw, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon.
Definition gf_graphic.c:30
-
void gf_graphic_perspective(gf_draw_t *draw, double fovy, double znear, double zfar)
Set perspective.
Definition gf_graphic.c:32
-
void gf_graphic_end_2d(gf_draw_t *draw)
End 2D mode.
Definition gf_graphic.c:24
-
void gf_graphic_begin_2d(gf_draw_t *draw)
Start 2D mode.
Definition gf_graphic.c:22
-
void gf_graphic_set_camera(gf_draw_t *draw)
Set camera.
Definition gf_graphic.c:34
#define GF_EXPORT
Macro for platform-dependent symbol export/import.
Definition gf_macro.h:190
Required headers before anything.
diff --git a/engine/draw_8h.html b/engine/draw_8h.html index 71b2f75..f3ea2b1 100644 --- a/engine/draw_8h.html +++ b/engine/draw_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/draw_8h_source.html b/engine/draw_8h_source.html index ab980ba..cd27ad8 100644 --- a/engine/draw_8h_source.html +++ b/engine/draw_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/draw__driver_8h.html b/engine/draw__driver_8h.html index da69397..64d2b4b 100644 --- a/engine/draw__driver_8h.html +++ b/engine/draw__driver_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/draw__driver_8h_source.html b/engine/draw__driver_8h_source.html index d89849e..0ec8a67 100644 --- a/engine/draw__driver_8h_source.html +++ b/engine/draw__driver_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/draw__platform_8h.html b/engine/draw__platform_8h.html index e3e4996..c0b65a8 100644 --- a/engine/draw__platform_8h.html +++ b/engine/draw__platform_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/draw__platform_8h_source.html b/engine/draw__platform_8h_source.html index 97ff2dc..babaef6 100644 --- a/engine/draw__platform_8h_source.html +++ b/engine/draw__platform_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/files.html b/engine/files.html index 31a4112..3d278fd 100644 --- a/engine/files.html +++ b/engine/files.html @@ -24,6 +24,7 @@ + - - - -
GoldFish Engine
@@ -181,10 +182,6 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });
 gf_stb_image.c
 gf_texture.c
 gf_version.c
  util
  engineinfo
 main_console.c
 main_windows.c
diff --git a/engine/files_dup.js b/engine/files_dup.js index ed06eb3..89e9042 100644 --- a/engine/files_dup.js +++ b/engine/files_dup.js @@ -1,6 +1,5 @@ var files_dup = [ [ "include", "dir_d44c64559bbebec7f509842c48db8b23.html", "dir_d44c64559bbebec7f509842c48db8b23" ], - [ "src", "dir_68267d1309a1af8e8297ef4c3efbcdba.html", "dir_68267d1309a1af8e8297ef4c3efbcdba" ], - [ "util", "dir_23ec12649285f9fabf3a6b7380226c28.html", "dir_23ec12649285f9fabf3a6b7380226c28" ] + [ "src", "dir_68267d1309a1af8e8297ef4c3efbcdba.html", "dir_68267d1309a1af8e8297ef4c3efbcdba" ] ]; \ No newline at end of file diff --git a/engine/font_8h.html b/engine/font_8h.html index 6365daf..e09951f 100644 --- a/engine/font_8h.html +++ b/engine/font_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/font_8h_source.html b/engine/font_8h_source.html index 64c8b6c..e040357 100644 --- a/engine/font_8h_source.html +++ b/engine/font_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/functions.html b/engine/functions.html index eacc1bf..ddb3d8b 100644 --- a/engine/functions.html +++ b/engine/functions.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/functions_vars.html b/engine/functions_vars.html index a2034b5..9dfa3a5 100644 --- a/engine/functions_vars.html +++ b/engine/functions_vars.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__audio_8c_source.html b/engine/gf__audio_8c_source.html index 0230b3f..f51ec82 100644 --- a/engine/gf__audio_8c_source.html +++ b/engine/gf__audio_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -147,7 +148,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
47 if(frame > readframe) {
48 ma_mutex_unlock(audio->mutex);
49 unlocked = 1;
- +
50 gf_audio_decoder_destroy(&audio->decoder[i]);
51 }
52 } else if(audio->decoder[i].used == 1 && audio->decoder[i].xm != NULL) {
53 int j;
@@ -164,7 +165,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
64 if(audio->decoder[i].samples <= 0) {
65 ma_mutex_unlock(audio->mutex);
66 unlocked = 1;
- +
67 gf_audio_decoder_destroy(&audio->decoder[i]);
68 }
69 } else if(audio->decoder[i].used == 1 && audio->decoder[i].mod != NULL) {
70 int j;
@@ -181,7 +182,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
81 if(audio->decoder[i].samples <= 0) {
82 ma_mutex_unlock(audio->mutex);
83 unlocked = 1;
- +
84 gf_audio_decoder_destroy(&audio->decoder[i]);
85 }
86 }
87 }
@@ -195,7 +196,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
95}
96
-
97gf_audio_id_t gf_audio_load(gf_audio_t* audio, const void* data, size_t size) {
+
97gf_audio_id_t gf_audio_load(gf_audio_t* audio, const void* data, size_t size) {
98 gf_audio_id_t i;
99 ma_mutex_lock(audio->mutex);
100 for(i = 0; i < GF_AUDIO_MAX_DECODERS; i++) {
@@ -251,7 +252,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
150
-
151gf_audio_id_t gf_audio_load_file(gf_audio_t* audio, const char* path) {
+
151gf_audio_id_t gf_audio_load_file(gf_audio_t* audio, const char* path) {
152 FILE* f = fopen(path, "rb");
153 size_t sz;
154 unsigned char* data;
@@ -263,7 +264,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
160
161 data = malloc(sz);
162 fread(data, sz, 1, f);
-
163 st = gf_audio_load(audio, data, sz);
+
163 st = gf_audio_load(audio, data, sz);
164
165 fclose(f);
166
@@ -272,7 +273,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
169
- +
170gf_audio_t* gf_audio_create(gf_engine_t* engine) {
171 gf_audio_t* audio = malloc(sizeof(*audio));
172 int i;
173
@@ -300,7 +301,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
195 gf_log_function(engine, "Failed to open playback device", "");
196 free(audio->device);
197 audio->device = NULL;
-
198 gf_audio_destroy(audio);
+
198 gf_audio_destroy(audio);
199 return NULL;
200 }
201
@@ -309,13 +310,13 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
204 gf_log_function(engine, "Failed to create mutex", "");
205 free(audio->mutex);
206 audio->mutex = NULL;
-
207 gf_audio_destroy(audio);
+
207 gf_audio_destroy(audio);
208 return NULL;
209 }
210
211 if(ma_device_start(audio->device) != MA_SUCCESS) {
212 gf_log_function(engine, "Failed to start playback device", "");
-
213 gf_audio_destroy(audio);
+
213 gf_audio_destroy(audio);
214 return NULL;
215 }
216
@@ -330,7 +331,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
225
- +
226void gf_audio_decoder_destroy(gf_audio_decoder_t* decoder) {
227 ma_mutex_lock(decoder->audio->mutex);
228 if(decoder->decoder != NULL) {
229 ma_decoder_uninit(decoder->decoder);
@@ -352,7 +353,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
245
- +
246void gf_audio_destroy(gf_audio_t* audio) {
247 int i;
248 if(audio->device != NULL) {
249 ma_device_uninit(audio->device);
@@ -363,7 +364,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
254 free(audio->mutex);
255 }
256 for(i = 0; i < GF_AUDIO_MAX_DECODERS; i++) {
- +
257 gf_audio_decoder_destroy(&audio->decoder[i]);
258 }
259 gf_log_function(audio->engine, "Destroyed audio interface", "");
260 free(audio);
@@ -371,7 +372,7 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
262
-
263void gf_audio_resume(gf_audio_t* audio, gf_audio_id_t id) {
+
263void gf_audio_resume(gf_audio_t* audio, gf_audio_id_t id) {
264 ma_mutex_lock(audio->mutex);
265 if(audio->decoder[id].used != 0) audio->decoder[id].used = 1;
266 ma_mutex_unlock(audio->mutex);
@@ -379,24 +380,16 @@ $(document).ready(function(){initNavTree('gf__audio_8c_source.html',''); initRes
268
-
269void gf_audio_pause(gf_audio_t* audio, gf_audio_id_t id) {
+
269void gf_audio_pause(gf_audio_t* audio, gf_audio_id_t id) {
270 ma_mutex_lock(audio->mutex);
271 if(audio->decoder[id].used != 0) audio->decoder[id].used = -1;
272 ma_mutex_unlock(audio->mutex);
273}
274
-
275void gf_audio_stop(gf_audio_t* audio, gf_audio_id_t id) { gf_audio_decoder_destroy(&audio->decoder[id]); }
+
275void gf_audio_stop(gf_audio_t* audio, gf_audio_id_t id) { gf_audio_decoder_destroy(&audio->decoder[id]); }
#define GF_AUDIO_MAX_DECODERS
Max decoders audio interface can handle.
Definition audio.h:33
Audio interface.
-
void gf_audio_stop(gf_audio_t *audio, gf_audio_id_t id)
Stop audio.
Definition gf_audio.c:275
-
void gf_audio_resume(gf_audio_t *audio, gf_audio_id_t id)
Resume audio.
Definition gf_audio.c:263
-
gf_audio_id_t gf_audio_load(gf_audio_t *audio, const void *data, size_t size)
Load and play data.
Definition gf_audio.c:97
-
gf_audio_t * gf_audio_create(gf_engine_t *engine)
Create audio interface.
Definition gf_audio.c:170
-
void gf_audio_destroy(gf_audio_t *audio)
Destroy audio interface.
Definition gf_audio.c:246
-
void gf_audio_decoder_destroy(gf_audio_decoder_t *decoder)
Destroy audio decoder.
Definition gf_audio.c:226
-
void gf_audio_pause(gf_audio_t *audio, gf_audio_id_t id)
Pause audio.
Definition gf_audio.c:269
-
gf_audio_id_t gf_audio_load_file(gf_audio_t *audio, const char *path)
Load and play file.
Definition gf_audio.c:151
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
Required headers before anything.
diff --git a/engine/gf__audio_8h.html b/engine/gf__audio_8h.html index c6a5a33..901bb23 100644 --- a/engine/gf__audio_8h.html +++ b/engine/gf__audio_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__audio_8h_source.html b/engine/gf__audio_8h_source.html index da0ba84..a361fc4 100644 --- a/engine/gf__audio_8h_source.html +++ b/engine/gf__audio_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__audio__mod_8c_source.html b/engine/gf__audio__mod_8c_source.html index 84641b0..479ac05 100644 --- a/engine/gf__audio__mod_8c_source.html +++ b/engine/gf__audio__mod_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__audio__xm_8c_source.html b/engine/gf__audio__xm_8c_source.html index ed15859..9da0682 100644 --- a/engine/gf__audio__xm_8c_source.html +++ b/engine/gf__audio__xm_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__client_8c_source.html b/engine/gf__client_8c_source.html index 996add7..a47f0ac 100644 --- a/engine/gf__client_8c_source.html +++ b/engine/gf__client_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -118,68 +119,53 @@ $(document).ready(function(){initNavTree('gf__client_8c_source.html',''); initRe
18#include <stdlib.h>
19#include <string.h>
20
- +
21void gf_client_begin(void) { gf_draw_begin(); }
22
-
23void gf_client_end(void) { gf_draw_end(); }
+
23void gf_client_end(void) { gf_draw_end(); }
24
-
25gf_client_t* gf_client_create(gf_engine_t* engine, const char* title) {
+
25gf_client_t* gf_client_create(gf_engine_t* engine, const char* title) {
26 gf_client_t* client = malloc(sizeof(*client));
27 memset(client, 0, sizeof(*client));
28 client->engine = engine;
-
29 client->draw = gf_draw_create(engine, title);
+
29 client->draw = gf_draw_create(engine, title);
30 if(client->draw == NULL) {
31 gf_log_function(engine, "Failed to create drawing interface", "");
-
32 gf_client_destroy(client);
+
32 gf_client_destroy(client);
33 return NULL;
34 }
-
35 client->audio = gf_audio_create(engine);
+
35 client->audio = gf_audio_create(engine);
36 if(client->audio == NULL) {
37 gf_log_function(engine, "Failed to create audio interface", "");
-
38 gf_client_destroy(client);
+
38 gf_client_destroy(client);
39 return NULL;
40 }
-
41 client->input = gf_input_create(engine);
-
42 gf_draw_set_input(client->draw, client->input);
+
41 client->input = gf_input_create(engine);
+
42 gf_draw_set_input(client->draw, client->input);
43 return client;
44}
45
- -
47 if(client->draw != NULL) gf_draw_destroy(client->draw);
-
48 if(client->audio != NULL) gf_audio_destroy(client->audio);
-
49 if(client->input != NULL) gf_input_destroy(client->input);
+
46void gf_client_destroy(gf_client_t* client) {
+
47 if(client->draw != NULL) gf_draw_destroy(client->draw);
+
48 if(client->audio != NULL) gf_audio_destroy(client->audio);
+
49 if(client->input != NULL) gf_input_destroy(client->input);
50 gf_log_function(client->engine, "Destroyed client interface", "");
51 free(client);
52}
53
- -
55 int s = gf_draw_step(client->draw);
+
54int gf_client_step(gf_client_t* client) {
+
55 int s = gf_draw_step(client->draw);
56 return s;
57}
Audio interface.
-
gf_audio_t * gf_audio_create(gf_engine_t *engine)
Create audio interface.
Definition gf_audio.c:170
-
void gf_audio_destroy(gf_audio_t *audio)
Destroy audio interface.
Definition gf_audio.c:246
Client interface.
-
void gf_client_begin(void)
Initialize client interface.
Definition gf_client.c:21
-
void gf_client_destroy(gf_client_t *client)
Destroy client interface.
Definition gf_client.c:46
-
gf_client_t * gf_client_create(gf_engine_t *engine, const char *title)
Create client interface.
Definition gf_client.c:25
-
void gf_client_end(void)
Cleanup client interface.
Definition gf_client.c:23
-
int gf_client_step(gf_client_t *client)
Do client single step.
Definition gf_client.c:54
Drawing interface.
-
void gf_draw_end(void)
Cleanup drawing stuffs.
-
void gf_draw_begin(void)
Initialize drawing stuffs.
-
int gf_draw_step(gf_draw_t *draw)
Do drawing single step.
-
void gf_draw_set_input(gf_draw_t *draw, gf_input_t *input)
Set input interface.
-
void gf_draw_destroy(gf_draw_t *draw)
Destroy drawing interface.
-
gf_draw_t * gf_draw_create(gf_engine_t *engine, const char *title)
Create drawing interface.
-
void gf_input_destroy(gf_input_t *input)
Destroy input interface.
Definition gf_input.c:29
-
gf_input_t * gf_input_create(gf_engine_t *engine)
Create input interface.
Definition gf_input.c:17
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
Required headers before anything.
diff --git a/engine/gf__client_8h.html b/engine/gf__client_8h.html index 55e7527..56a1a46 100644 --- a/engine/gf__client_8h.html +++ b/engine/gf__client_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__client_8h_source.html b/engine/gf__client_8h_source.html index bffa055..08f3921 100644 --- a/engine/gf__client_8h_source.html +++ b/engine/gf__client_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__core_8c_source.html b/engine/gf__core_8c_source.html index b34863f..d7e8eec 100644 --- a/engine/gf__core_8c_source.html +++ b/engine/gf__core_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -122,12 +123,12 @@ $(document).ready(function(){initNavTree('gf__core_8c_source.html',''); initResi
22#include <stdio.h>
23
-
24void gf_engine_begin(void) {
+
24void gf_engine_begin(void) {
25 gf_version_t ver;
26#ifdef _WIN32
27 WSADATA wsa;
28#endif
-
29 gf_version_get(&ver);
+
29 gf_version_get(&ver);
30 gf_log_function(NULL, "GoldFish Engine %s", ver.full);
31 gf_log_function(NULL, "Build date: %s", ver.date);
32 gf_log_function(NULL, "Lua %s", ver.lua);
@@ -138,20 +139,20 @@ $(document).ready(function(){initNavTree('gf__core_8c_source.html',''); initResi
37 WSAStartup(MAKEWORD(1, 1), &wsa);
38 gf_log_function(NULL, "Winsock ready", "");
39#endif
- - +
40 gf_client_begin();
+
41 gf_server_begin();
42}
43
-
44void gf_engine_end(void) {
- - +
44void gf_engine_end(void) {
+
45 gf_server_end();
+
46 gf_client_end();
47}
48
-
49gf_engine_t* gf_engine_create(const char* title, int nogui) {
+
49gf_engine_t* gf_engine_create(const char* title, int nogui) {
50 gf_engine_t* engine = malloc(sizeof(*engine));
51 memset(engine, 0, sizeof(*engine));
52 engine->log = stderr;
@@ -160,59 +161,44 @@ $(document).ready(function(){initNavTree('gf__core_8c_source.html',''); initResi
55 engine->client = NULL;
56 } else {
57 gf_log_function(engine, "GUI mode", "");
-
58 engine->client = gf_client_create(engine, title);
+
58 engine->client = gf_client_create(engine, title);
59 if(engine->client == NULL) {
60 gf_log_function(engine, "Failed to create client interface", "");
-
61 gf_engine_destroy(engine);
+
61 gf_engine_destroy(engine);
62 return NULL;
63 }
64 gf_log_function(engine, "Switching to graphical console", "");
65 }
-
66 engine->server = gf_server_create(engine);
+
66 engine->server = gf_server_create(engine);
67 return engine;
68}
69
- +
84void gf_engine_loop(gf_engine_t* engine) {
85 while(1) {
86 if(engine->client != NULL) {
-
87 if(gf_client_step(engine->client) != 0) break;
+
87 if(gf_client_step(engine->client) != 0) break;
88 }
89 }
90}
91
- -
93 if(engine->server != NULL) gf_server_destroy(engine->server);
-
94 if(engine->client != NULL) gf_client_destroy(engine->client);
+
92void gf_engine_destroy(gf_engine_t* engine) {
+
93 if(engine->server != NULL) gf_server_destroy(engine->server);
+
94 if(engine->client != NULL) gf_client_destroy(engine->client);
95 free(engine);
96 gf_log_function(NULL, "Destroyed engine", "");
97}
Client interface.
-
void gf_client_begin(void)
Initialize client interface.
Definition gf_client.c:21
-
void gf_client_destroy(gf_client_t *client)
Destroy client interface.
Definition gf_client.c:46
-
gf_client_t * gf_client_create(gf_engine_t *engine, const char *title)
Create client interface.
Definition gf_client.c:25
-
void gf_client_end(void)
Cleanup client interface.
Definition gf_client.c:23
-
int gf_client_step(gf_client_t *client)
Do client single step.
Definition gf_client.c:54
-
gf_engine_t * gf_engine_create(const char *title, int nogui)
Create engine instance.
Definition gf_core.c:49
-
void gf_engine_destroy(gf_engine_t *engine)
Destroy engine instance.
Definition gf_core.c:92
-
void gf_engine_loop(gf_engine_t *engine)
Start engine main loop.
Definition gf_core.c:84
-
void gf_engine_end(void)
Cleanup engine.
Definition gf_core.c:44
-
void gf_engine_begin(void)
Initialize engine.
Definition gf_core.c:24
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
Required headers before anything.
Client interface.
-
void gf_server_begin(void)
Initialize server interface.
Definition gf_server.c:18
-
gf_server_t * gf_server_create(gf_engine_t *engine)
Create server interface.
Definition gf_server.c:22
-
void gf_server_end(void)
Cleanup server interface.
Definition gf_server.c:20
-
void gf_server_destroy(gf_server_t *server)
Destroy server interface.
Definition gf_server.c:35
Version.
-
void gf_version_get(gf_version_t *version)
Get version of engine.
Definition gf_version.c:18
Engine instance.
Definition core.h:46
gf_server_t * server
Server interface.
Definition core.h:46
FILE * log
Log output.
Definition core.h:46
diff --git a/engine/gf__core_8h.html b/engine/gf__core_8h.html index c34f522..25f7f33 100644 --- a/engine/gf__core_8h.html +++ b/engine/gf__core_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__core_8h_source.html b/engine/gf__core_8h_source.html index f0f73e0..0517ebd 100644 --- a/engine/gf__core_8h_source.html +++ b/engine/gf__core_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__directx_8h.html b/engine/gf__directx_8h.html index 763aeab..cee3305 100644 --- a/engine/gf__directx_8h.html +++ b/engine/gf__directx_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__directx_8h_source.html b/engine/gf__directx_8h_source.html index 911373b..067e023 100644 --- a/engine/gf__directx_8h_source.html +++ b/engine/gf__directx_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__draw_8h.html b/engine/gf__draw_8h.html index e35ec58..06d22a9 100644 --- a/engine/gf__draw_8h.html +++ b/engine/gf__draw_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__draw_8h_source.html b/engine/gf__draw_8h_source.html index 661849d..e8425d1 100644 --- a/engine/gf__draw_8h_source.html +++ b/engine/gf__draw_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__draw__common_8c_source.html b/engine/gf__draw__common_8c_source.html index 86256e3..296b5a5 100644 --- a/engine/gf__draw__common_8c_source.html +++ b/engine/gf__draw__common_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -123,14 +124,14 @@ $(document).ready(function(){initNavTree('gf__draw__common_8c_source.html','');
23#include <string.h>
24#include <math.h>
25
- +
26void gf_draw_begin(void) { gf_draw_platform_begin(); }
27
- +
28void gf_draw_end(void) { gf_draw_platform_end(); }
29
30gf_texture_t* test_texture;
31
-
32gf_draw_t* gf_draw_create(gf_engine_t* engine, const char* title) {
+
32gf_draw_t* gf_draw_create(gf_engine_t* engine, const char* title) {
33 gf_draw_t* draw = malloc(sizeof(*draw));
34 memset(draw, 0, sizeof(*draw));
35 draw->engine = engine;
@@ -142,10 +143,10 @@ $(document).ready(function(){initNavTree('gf__draw__common_8c_source.html','');
41 draw->draw_3d = 0;
42 draw->font = NULL;
43 strcpy(draw->title, title);
-
44 draw->platform = gf_draw_platform_create(engine, draw);
+
44 draw->platform = gf_draw_platform_create(engine, draw);
45 if(draw->platform != NULL) {
-
46 draw->driver = gf_draw_driver_create(engine, draw);
-
47 gf_draw_reshape(draw);
+
46 draw->driver = gf_draw_driver_create(engine, draw);
+
47 gf_draw_reshape(draw);
48 draw->running = 1;
49
50 draw->light[0] = 0.0;
@@ -161,24 +162,24 @@ $(document).ready(function(){initNavTree('gf__draw__common_8c_source.html','');
60 draw->lookat[1] = 0;
61 draw->lookat[2] = 0;
62
-
63 draw->font = gf_font_create(draw, "font/helvR24.bdf");
+
63 draw->font = gf_font_create(draw, "font/helvR24.bdf");
64
-
65 draw->gui = gf_gui_create(engine, draw);
+
65 draw->gui = gf_gui_create(engine, draw);
66 if(1) {
67 int w, h, c;
68 unsigned char* d = stbi_load("texture/test.bmp", &w, &h, &c, 4);
-
69 test_texture = gf_texture_create(draw, w, h, d);
+
69 test_texture = gf_texture_create(draw, w, h, d);
70 free(d);
71 }
72 } else {
-
73 gf_draw_destroy(draw);
+
73 gf_draw_destroy(draw);
74 draw = NULL;
75 }
76 return draw;
77}
78
- +
79void gf_draw_reshape(gf_draw_t* draw) { gf_draw_driver_reshape(draw); }
80
81gf_gui_id_t button1 = -1;
82gf_gui_id_t button2 = -1;
@@ -191,19 +192,19 @@ $(document).ready(function(){initNavTree('gf__draw__common_8c_source.html','');
89
90/* Runs every frame */
- +
91void gf_draw_frame(gf_draw_t* draw) {
93 color.r = color.g = color.b = color.a = 255;
94 if(button1 == -1) {
-
95 button1 = gf_gui_create_button(draw->gui, 0, 0, 200, 50, "\"Test\" text");
-
96 gf_gui_set_callback(draw->gui, button1, gf_button_callback);
+
95 button1 = gf_gui_create_button(draw->gui, 0, 0, 200, 50, "\"Test\" text");
+
96 gf_gui_set_callback(draw->gui, button1, gf_button_callback);
97 }
98 if(button2 == -1) {
-
99 button2 = gf_gui_create_button(draw->gui, 100, 25, 200, 50, "\"Test\" text");
-
100 gf_gui_set_callback(draw->gui, button2, gf_button_callback);
+
99 button2 = gf_gui_create_button(draw->gui, 100, 25, 200, 50, "\"Test\" text");
+
100 gf_gui_set_callback(draw->gui, button2, gf_button_callback);
101 }
102 if(draw->draw_3d) {
-
103 gf_graphic_draw_texture_polygon(draw, test_texture, color, GF_GRAPHIC_3D, 4,
+
103 gf_graphic_draw_texture_polygon(draw, test_texture, color, GF_GRAPHIC_3D, 4,
104 /* clang-format off */
105 0.0, 0.0,
106 -1.0, 0.0, -1.0,
@@ -219,13 +220,13 @@ $(document).ready(function(){initNavTree('gf__draw__common_8c_source.html','');
116 /* clang-format on */
117 );
118 }
-
119 gf_gui_render(draw->gui);
+
119 gf_gui_render(draw->gui);
120}
121
- -
123 int ret = gf_draw_platform_step(draw);
+
122int gf_draw_step(gf_draw_t* draw) {
+
123 int ret = gf_draw_platform_step(draw);
124 if(ret != 0) return ret;
125 draw->close = 0;
126
@@ -234,50 +235,27 @@ $(document).ready(function(){initNavTree('gf__draw__common_8c_source.html','');
129
- -
131 if(draw->driver != NULL) gf_draw_driver_destroy(draw->driver);
-
132 if(draw->platform != NULL) gf_draw_platform_destroy(draw->platform);
+
130void gf_draw_destroy(gf_draw_t* draw) {
+
131 if(draw->driver != NULL) gf_draw_driver_destroy(draw->driver);
+
132 if(draw->platform != NULL) gf_draw_platform_destroy(draw->platform);
133 gf_log_function(draw->engine, "Destroyed drawing interface", "");
134 free(draw);
135}
136
-
137void gf_draw_set_input(gf_draw_t* draw, gf_input_t* input) { draw->input = input; }
+
137void gf_draw_set_input(gf_draw_t* draw, gf_input_t* input) { draw->input = input; }
Drawing interface.
-
void gf_draw_end(void)
Cleanup drawing stuffs.
-
void gf_draw_begin(void)
Initialize drawing stuffs.
-
int gf_draw_step(gf_draw_t *draw)
Do drawing single step.
-
void gf_draw_frame(gf_draw_t *draw)
Draw frame (common part)
-
void gf_draw_set_input(gf_draw_t *draw, gf_input_t *input)
Set input interface.
-
void gf_draw_destroy(gf_draw_t *draw)
Destroy drawing interface.
-
void gf_draw_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
-
gf_draw_t * gf_draw_create(gf_engine_t *engine, const char *title)
Create drawing interface.
Drawing driver.
-
gf_draw_driver_t * gf_draw_driver_create(gf_engine_t *engine, gf_draw_t *draw)
Initialize drawing driver.
Definition gf_driver.c:35
-
void gf_draw_driver_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
Definition gf_driver.c:47
-
void gf_draw_driver_destroy(gf_draw_driver_t *driver)
Destroy drawing driver.
Definition gf_driver.c:55
Platform-dependent part of drawing driver.
-
void gf_draw_platform_destroy(gf_draw_platform_t *platform)
Destroy platform-dependent part of drawing driver.
Definition gf_draw.c:179
-
void gf_draw_platform_begin(void)
Initialize platform-dependent part of drawing driver.
Definition gf_draw.c:23
-
void gf_draw_platform_end(void)
Cleanup platform-dependent part of drawing driver.
Definition gf_draw.c:24
-
gf_draw_platform_t * gf_draw_platform_create(gf_engine_t *engine, gf_draw_t *draw)
Create platform-dependent part of drawing driver.
Definition gf_draw.c:123
-
int gf_draw_platform_step(gf_draw_t *draw)
Do platform-dependent step.
Definition gf_draw.c:101
-
gf_font_t * gf_font_create(gf_draw_t *draw, const char *path)
Load font.
Definition gf_font.c:141
Graphic interface.
#define GF_GRAPHIC_3D
Dimension parameter for 3D.
Definition gf_graphic.h:32
-
void gf_graphic_draw_texture_polygon(gf_draw_t *draw, gf_texture_t *texture, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon with texture.
Definition gf_graphic.c:28
-
void gf_gui_render(gf_gui_t *gui)
Render GUI.
Definition gf_gui.c:96
-
gf_gui_t * gf_gui_create(gf_engine_t *engine, gf_draw_t *draw)
Create GUI.
Definition gf_gui.c:26
-
gf_gui_id_t gf_gui_create_button(gf_gui_t *gui, double x, double y, double w, double h, const char *text)
Create button component.
Definition gf_gui.c:78
-
void gf_gui_set_callback(gf_gui_t *gui, gf_gui_id_t id, gf_gui_callback_t callback)
Set callback.
Definition gf_gui.c:145
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
Required headers before anything.
Texture.
-
gf_texture_t * gf_texture_create(gf_draw_t *draw, int width, int height, unsigned char *data)
Create texture.
Definition gf_texture.c:17
int gf_gui_id_t
Component ID.
Definition gui.h:17
Type definitions related to math.
Drawing interface.
Definition draw.h:108
diff --git a/engine/gf__draw__driver_8h.html b/engine/gf__draw__driver_8h.html index e31cecd..d887818 100644 --- a/engine/gf__draw__driver_8h.html +++ b/engine/gf__draw__driver_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__draw__driver_8h_source.html b/engine/gf__draw__driver_8h_source.html index c40d6cc..1c1da6b 100644 --- a/engine/gf__draw__driver_8h_source.html +++ b/engine/gf__draw__driver_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__draw__platform_8h.html b/engine/gf__draw__platform_8h.html index 474296d..13c385e 100644 --- a/engine/gf__draw__platform_8h.html +++ b/engine/gf__draw__platform_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__draw__platform_8h_source.html b/engine/gf__draw__platform_8h_source.html index 5fe5e2c..e2781b3 100644 --- a/engine/gf__draw__platform_8h_source.html +++ b/engine/gf__draw__platform_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__font_8c_source.html b/engine/gf__font_8c_source.html index 6fa38e2..6154f16 100644 --- a/engine/gf__font_8c_source.html +++ b/engine/gf__font_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -118,7 +119,7 @@ $(document).ready(function(){initNavTree('gf__font_8c_source.html',''); initResi
18#include <stdio.h>
19
- +
20gf_font_glyph_t* gf_font_get(gf_font_t* font, int code) {
21 int i;
22 if(code < 0x20) return NULL;
23 for(i = 0; i < font->count; i++) {
@@ -192,7 +193,7 @@ $(document).ready(function(){initNavTree('gf__font_8c_source.html',''); initResi
93 font->glyph[store->glyph_index] = malloc(sizeof(**font->glyph));
94 memset(font->glyph[store->glyph_index], 0, sizeof(**font->glyph));
95 } else if(argc > 0 && strcmp(args[0], "ENDCHAR") == 0) {
-
96 font->glyph[store->glyph_index]->texture = gf_texture_create(draw, font->glyph[store->glyph_index]->bbox.width, font->glyph[store->glyph_index]->bbox.height, store->buffer);
+
96 font->glyph[store->glyph_index]->texture = gf_texture_create(draw, font->glyph[store->glyph_index]->bbox.width, font->glyph[store->glyph_index]->bbox.height, store->buffer);
97 free(store->buffer);
98 store->glyph_index++;
99 store->line_index = -1;
@@ -238,7 +239,7 @@ $(document).ready(function(){initNavTree('gf__font_8c_source.html',''); initResi
139}
140
-
141gf_font_t* gf_font_create(gf_draw_t* draw, const char* path) {
+
141gf_font_t* gf_font_create(gf_draw_t* draw, const char* path) {
142 gf_font_t* font = malloc(sizeof(*font));
143 struct gf_stat s;
144 char* buf;
@@ -278,14 +279,11 @@ $(document).ready(function(){initNavTree('gf__font_8c_source.html',''); initResi
178}
-
gf_font_t * gf_font_create(gf_draw_t *draw, const char *path)
Load font.
Definition gf_font.c:141
-
gf_font_glyph_t * gf_font_get(gf_font_t *font, int code)
Get glyph.
Definition gf_font.c:20
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
#define GF_DECLARE_TYPE(n, b)
Macro to define engine type shorter.
Definition gf_macro.h:180
Required headers before anything.
Texture.
-
gf_texture_t * gf_texture_create(gf_draw_t *draw, int width, int height, unsigned char *data)
Create texture.
Definition gf_texture.c:17
Drawing interface.
Definition draw.h:108
int y
Y coord.
Definition font.h:47
int width
Width.
Definition font.h:47
diff --git a/engine/gf__font_8h.html b/engine/gf__font_8h.html index 9cbebe6..38e81a0 100644 --- a/engine/gf__font_8h.html +++ b/engine/gf__font_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__font_8h_source.html b/engine/gf__font_8h_source.html index 40168b3..196b242 100644 --- a/engine/gf__font_8h_source.html +++ b/engine/gf__font_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__graphic_8h.html b/engine/gf__graphic_8h.html index d9d29ea..2b82902 100644 --- a/engine/gf__graphic_8h.html +++ b/engine/gf__graphic_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__graphic_8h_source.html b/engine/gf__graphic_8h_source.html index 1bbb19f..899df9c 100644 --- a/engine/gf__graphic_8h_source.html +++ b/engine/gf__graphic_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__graphic__common_8c_source.html b/engine/gf__graphic__common_8c_source.html index 2a2b733..17ce708 100644 --- a/engine/gf__graphic__common_8c_source.html +++ b/engine/gf__graphic__common_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -116,10 +117,10 @@ $(document).ready(function(){initNavTree('gf__graphic__common_8c_source.html',''
16/* Standard */
17#include <string.h>
18
-
19void gf_graphic_fill_rect(gf_draw_t* draw, double x, double y, double w, double h, gf_graphic_color_t color) { gf_graphic_fill_polygon(draw, color, GF_GRAPHIC_2D, 4, x, y, x, y + h, x + w, y + h, x + w, y); }
+
19void gf_graphic_fill_rect(gf_draw_t* draw, double x, double y, double w, double h, gf_graphic_color_t color) { gf_graphic_fill_polygon(draw, color, GF_GRAPHIC_2D, 4, x, y, x, y + h, x + w, y + h, x + w, y); }
20
-
21void gf_graphic_text(gf_draw_t* draw, double x, double y, double size, const char* text, gf_graphic_color_t color) {
+
21void gf_graphic_text(gf_draw_t* draw, double x, double y, double size, const char* text, gf_graphic_color_t color) {
22 int i;
23 double mx = 0;
24 gf_font_glyph_t* glyph;
@@ -127,12 +128,12 @@ $(document).ready(function(){initNavTree('gf__graphic__common_8c_source.html',''
26 if(draw->font != NULL) {
27 zoom = size / draw->font->bbox.height;
28 for(i = 0; text[i] != 0; i++) {
-
29 if((glyph = gf_font_get(draw->font, text[i])) != NULL) {
+
29 if((glyph = gf_font_get(draw->font, text[i])) != NULL) {
30 double fax = glyph->bbox.width;
31 double fay = glyph->bbox.height;
32 double fx = glyph->bbox.x;
33 double fy = (draw->font->bbox.height + draw->font->bbox.y) - (glyph->bbox.height + glyph->bbox.y);
-
34 gf_graphic_draw_texture_2d(draw, x + mx + fx * zoom, y + fy * zoom, zoom * fax, zoom * fay, glyph->texture, color);
+
34 gf_graphic_draw_texture_2d(draw, x + mx + fx * zoom, y + fy * zoom, zoom * fax, zoom * fay, glyph->texture, color);
35 mx += zoom * glyph->dwidth[0];
36 }
37 }
@@ -141,7 +142,7 @@ $(document).ready(function(){initNavTree('gf__graphic__common_8c_source.html',''
40
-
41double gf_graphic_text_width(gf_draw_t* draw, double size, const char* text) {
+
41double gf_graphic_text_width(gf_draw_t* draw, double size, const char* text) {
42 int i;
43 double mx = 0;
44 gf_font_glyph_t* glyph;
@@ -149,7 +150,7 @@ $(document).ready(function(){initNavTree('gf__graphic__common_8c_source.html',''
46 if(draw->font != NULL) {
47 zoom = size / draw->font->bbox.height;
48 for(i = 0; text[i] != 0; i++) {
-
49 if((glyph = gf_font_get(draw->font, text[i])) != NULL) {
+
49 if((glyph = gf_font_get(draw->font, text[i])) != NULL) {
50 mx += zoom * glyph->dwidth[0];
51 }
52 }
@@ -159,20 +160,13 @@ $(document).ready(function(){initNavTree('gf__graphic__common_8c_source.html',''
56
-
57void gf_graphic_draw_texture_2d(gf_draw_t* draw, double x, double y, double w, double h, gf_texture_t* texture, gf_graphic_color_t color) {
-
58 if(texture != NULL) gf_graphic_draw_texture_polygon(draw, texture, color, GF_GRAPHIC_2D, 4, 0.0, 0.0, x, y, 0.0, 1.0, x, y + h, 1.0, 1.0, x + w, y + h, 1.0, 0.0, x + w, y);
+
57void gf_graphic_draw_texture_2d(gf_draw_t* draw, double x, double y, double w, double h, gf_texture_t* texture, gf_graphic_color_t color) {
+
58 if(texture != NULL) gf_graphic_draw_texture_polygon(draw, texture, color, GF_GRAPHIC_2D, 4, 0.0, 0.0, x, y, 0.0, 1.0, x, y + h, 1.0, 1.0, x + w, y + h, 1.0, 0.0, x + w, y);
59}
Drawing interface.
-
gf_font_glyph_t * gf_font_get(gf_font_t *font, int code)
Get glyph.
Definition gf_font.c:20
Graphic interface.
-
void gf_graphic_draw_texture_2d(gf_draw_t *draw, double x, double y, double w, double h, gf_texture_t *texture, gf_graphic_color_t color)
Draw rectangle with texture.
-
void gf_graphic_draw_texture_polygon(gf_draw_t *draw, gf_texture_t *texture, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon with texture.
Definition gf_graphic.c:28
-
void gf_graphic_fill_rect(gf_draw_t *draw, double x, double y, double w, double h, gf_graphic_color_t color)
Draw filled rectangle.
-
void gf_graphic_fill_polygon(gf_draw_t *draw, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon.
Definition gf_graphic.c:30
-
void gf_graphic_text(gf_draw_t *draw, double x, double y, double size, const char *text, gf_graphic_color_t color)
Draw text.
-
double gf_graphic_text_width(gf_draw_t *draw, double size, const char *text)
Calculate text width.
#define GF_GRAPHIC_2D
Dimension parameter for 2D.
Definition gf_graphic.h:26
Required headers before anything.
Drawing interface.
Definition draw.h:108
diff --git a/engine/gf__gui_8c_source.html b/engine/gf__gui_8c_source.html index 5beb506..80c2e61 100644 --- a/engine/gf__gui_8c_source.html +++ b/engine/gf__gui_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -124,7 +125,7 @@ $(document).ready(function(){initNavTree('gf__gui_8c_source.html',''); initResiz
24gf_graphic_color_t gf_gui_font_color;
25
- +
26gf_gui_t* gf_gui_create(gf_engine_t* engine, gf_draw_t* draw) {
27 gf_gui_t* gui = malloc(sizeof(*gui));
29 memset(gui, 0, sizeof(*gui));
@@ -145,7 +146,7 @@ $(document).ready(function(){initNavTree('gf__gui_8c_source.html',''); initResiz
43/* note... left top should be the lightest in the border */
44
-
45void gf_gui_draw_box(gf_gui_t* gui, int mul, double x, double y, double w, double h) {
+
45void gf_gui_draw_box(gf_gui_t* gui, int mul, double x, double y, double w, double h) {
46 const int color_diff = 32; /* color diff */
48
@@ -155,21 +156,21 @@ $(document).ready(function(){initNavTree('gf__gui_8c_source.html',''); initResiz
52 col.r += cd;
53 col.g += cd;
54 col.b += cd;
-
55 gf_graphic_fill_rect(gui->draw, x, y, w, h, col);
+
55 gf_graphic_fill_rect(gui->draw, x, y, w, h, col);
56
57 col = gf_gui_base_color;
58 col.r -= cd;
59 col.g -= cd;
60 col.b -= cd;
-
61 gf_graphic_fill_polygon(gui->draw, col, GF_GRAPHIC_2D, 5, x + w, y + h, x + w, y, x + w - gf_gui_border_width, y + gf_gui_border_width, x + gf_gui_border_width, y + h - gf_gui_border_width, x, y + h);
+
61 gf_graphic_fill_polygon(gui->draw, col, GF_GRAPHIC_2D, 5, x + w, y + h, x + w, y, x + w - gf_gui_border_width, y + gf_gui_border_width, x + gf_gui_border_width, y + h - gf_gui_border_width, x, y + h);
62
63 col = gf_gui_base_color;
-
64 gf_graphic_fill_rect(gui->draw, x + gf_gui_border_width, y + gf_gui_border_width, w - gf_gui_border_width * 2, h - gf_gui_border_width * 2, col);
+
64 gf_graphic_fill_rect(gui->draw, x + gf_gui_border_width, y + gf_gui_border_width, w - gf_gui_border_width * 2, h - gf_gui_border_width * 2, col);
65}
66
- +
67gf_gui_component_t* gf_gui_first_unused(gf_gui_t* gui, gf_gui_id_t* id) {
69 for(i = 0; i < GF_GUI_MAX_COMPONENTS; i++) {
70 if(gui->area[i].type == GF_GUI_UNUSED) {
@@ -182,9 +183,9 @@ $(document).ready(function(){initNavTree('gf__gui_8c_source.html',''); initResiz
77
-
78gf_gui_id_t gf_gui_create_button(gf_gui_t* gui, double x, double y, double w, double h, const char* text) {
+
78gf_gui_id_t gf_gui_create_button(gf_gui_t* gui, double x, double y, double w, double h, const char* text) {
79 gf_gui_id_t id;
- +
80 gf_gui_component_t* c = gf_gui_first_unused(gui, &id);
81
82 c->type = GF_GUI_BUTTON;
83 c->x = x;
@@ -202,7 +203,7 @@ $(document).ready(function(){initNavTree('gf__gui_8c_source.html',''); initResiz
95
- +
96void gf_gui_render(gf_gui_t* gui) {
98 gf_input_t* input = gui->draw->input;
99 for(i = GF_GUI_MAX_COMPONENTS - 1; i >= 0; i--) {
@@ -230,14 +231,14 @@ $(document).ready(function(){initNavTree('gf__gui_8c_source.html',''); initResiz
121 double ch = c->height;
122 switch(c->type) {
123 case GF_GUI_BUTTON: {
-
124 double x = cx + cw / 2 - gf_graphic_text_width(gui->draw, GF_GUI_FONT_SIZE, c->u.button.text) / 2;
+
124 double x = cx + cw / 2 - gf_graphic_text_width(gui->draw, GF_GUI_FONT_SIZE, c->u.button.text) / 2;
125 double y = cy + ch / 2 - GF_GUI_FONT_SIZE / 2;
126 if(gui->pressed == i) {
127 x += gf_gui_border_width / 1;
128 y += gf_gui_border_width / 1;
129 }
-
130 gf_gui_draw_box(gui, (gui->pressed == i) ? GF_GUI_INVERT : GF_GUI_NORMAL, cx, cy, cw, ch);
-
131 gf_graphic_text(gui->draw, x, y, GF_GUI_FONT_SIZE, c->u.button.text, gf_gui_font_color);
+
130 gf_gui_draw_box(gui, (gui->pressed == i) ? GF_GUI_INVERT : GF_GUI_NORMAL, cx, cy, cw, ch);
+
131 gf_graphic_text(gui->draw, x, y, GF_GUI_FONT_SIZE, c->u.button.text, gf_gui_font_color);
132 break;
133 }
134 }
@@ -252,24 +253,14 @@ $(document).ready(function(){initNavTree('gf__gui_8c_source.html',''); initResiz
143}
144
-
145void gf_gui_set_callback(gf_gui_t* gui, gf_gui_id_t id, gf_gui_callback_t callback) { gui->area[id].callback = callback; }
+
145void gf_gui_set_callback(gf_gui_t* gui, gf_gui_id_t id, gf_gui_callback_t callback) { gui->area[id].callback = callback; }
Drawing interface.
Graphic interface.
#define GF_SET_COLOR(color, red, green, blue, alpha)
Macro to set color safely and shorter.
Definition gf_graphic.h:39
-
void gf_graphic_fill_rect(gf_draw_t *draw, double x, double y, double w, double h, gf_graphic_color_t color)
Draw filled rectangle.
-
void gf_graphic_fill_polygon(gf_draw_t *draw, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon.
Definition gf_graphic.c:30
-
void gf_graphic_text(gf_draw_t *draw, double x, double y, double size, const char *text, gf_graphic_color_t color)
Draw text.
-
double gf_graphic_text_width(gf_draw_t *draw, double size, const char *text)
Calculate text width.
#define GF_GRAPHIC_2D
Dimension parameter for 2D.
Definition gf_graphic.h:26
#define GF_GUI_INVERT
Draw border inverted.
Definition gf_gui.h:32
-
gf_gui_component_t * gf_gui_first_unused(gf_gui_t *gui, gf_gui_id_t *id)
Get first unused component entry.
Definition gf_gui.c:67
-
void gf_gui_render(gf_gui_t *gui)
Render GUI.
Definition gf_gui.c:96
#define GF_GUI_FONT_SIZE
Default GUI font size.
Definition gf_gui.h:38
-
void gf_gui_draw_box(gf_gui_t *gui, int mul, double x, double y, double w, double h)
Render box.
Definition gf_gui.c:45
-
gf_gui_t * gf_gui_create(gf_engine_t *engine, gf_draw_t *draw)
Create GUI.
Definition gf_gui.c:26
-
gf_gui_id_t gf_gui_create_button(gf_gui_t *gui, double x, double y, double w, double h, const char *text)
Create button component.
Definition gf_gui.c:78
-
void gf_gui_set_callback(gf_gui_t *gui, gf_gui_id_t id, gf_gui_callback_t callback)
Set callback.
Definition gf_gui.c:145
#define GF_GUI_NORMAL
Draw border normally.
Definition gf_gui.h:26
Logger.
Required headers before anything.
diff --git a/engine/gf__gui_8h.html b/engine/gf__gui_8h.html index a2dbd64..ba7a633 100644 --- a/engine/gf__gui_8h.html +++ b/engine/gf__gui_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__gui_8h_source.html b/engine/gf__gui_8h_source.html index e0f7a3a..ed20c81 100644 --- a/engine/gf__gui_8h_source.html +++ b/engine/gf__gui_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__input_8c_source.html b/engine/gf__input_8c_source.html index 8a00bb3..ea8f5a9 100644 --- a/engine/gf__input_8c_source.html +++ b/engine/gf__input_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -115,7 +116,7 @@ $(document).ready(function(){initNavTree('gf__input_8c_source.html',''); initRes
15#include <string.h>
16
- +
17gf_input_t* gf_input_create(gf_engine_t* engine) {
18 gf_input_t* input = malloc(sizeof(*input));
19 memset(input, 0, sizeof(input));
20 input->engine = engine;
@@ -129,14 +130,12 @@ $(document).ready(function(){initNavTree('gf__input_8c_source.html',''); initRes
28
- +
29void gf_input_destroy(gf_input_t* input) {
30 gf_log_function(input->engine, "Destroyed input interface", "");
31 free(input);
32}
-
void gf_input_destroy(gf_input_t *input)
Destroy input interface.
Definition gf_input.c:29
-
gf_input_t * gf_input_create(gf_engine_t *engine)
Create input interface.
Definition gf_input.c:17
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
Required headers before anything.
diff --git a/engine/gf__input_8h.html b/engine/gf__input_8h.html index 4da6b6a..8037ab1 100644 --- a/engine/gf__input_8h.html +++ b/engine/gf__input_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__input_8h_source.html b/engine/gf__input_8h_source.html index 079b3ef..ad30a4b 100644 --- a/engine/gf__input_8h_source.html +++ b/engine/gf__input_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__log_8c_source.html b/engine/gf__log_8c_source.html index 5e6277e..ccf3fa1 100644 --- a/engine/gf__log_8c_source.html +++ b/engine/gf__log_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -116,7 +117,7 @@ $(document).ready(function(){initNavTree('gf__log_8c_source.html',''); initResiz
16#include <stddef.h>
17
-
18void gf_log(gf_engine_t* engine, const char* fmt, ...) {
+
18void gf_log(gf_engine_t* engine, const char* fmt, ...) {
19 va_list va;
20 FILE* out = stderr;
21 if(engine != NULL) {
@@ -131,7 +132,6 @@ $(document).ready(function(){initNavTree('gf__log_8c_source.html',''); initResiz
Logger.
-
void gf_log(gf_engine_t *engine, const char *fmt,...)
Output log.
Definition gf_log.c:18
Required headers before anything.
Engine instance.
Definition core.h:46
FILE * log
Log output.
Definition core.h:46
diff --git a/engine/gf__log_8h.html b/engine/gf__log_8h.html index 2faec1f..5df5442 100644 --- a/engine/gf__log_8h.html +++ b/engine/gf__log_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -107,7 +108,7 @@ $(document).ready(function(){initNavTree('gf__log_8h.html',''); initResizable(); - +

Macros

#define gf_log_function(engine, fmt, ...)   gf_log(engine, "%6d %24s: " fmt "\n", __LINE__, __FUNCTION_NAME__, __VA_ARGS__)
#define gf_log_function(engine, fmt, ...)   gf_log(engine, "%6d %24s: " fmt "\n", __LINE__, __FUNCTION_NAME__, __VA_ARGS__)
 Output log with line number and function name.
 
@@ -149,7 +150,7 @@ Functions - +
)   gf_log(engine, "%6d %24s: " fmt "\n", __LINE__, __FUNCTION_NAME__, __VA_ARGS__)   gf_log(engine, "%6d %24s: " fmt "\n", __LINE__, __FUNCTION_NAME__, __VA_ARGS__)
diff --git a/engine/gf__log_8h_source.html b/engine/gf__log_8h_source.html index 801fbe9..0aaaf5d 100644 --- a/engine/gf__log_8h_source.html +++ b/engine/gf__log_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__macro_8h.html b/engine/gf__macro_8h.html index 3075b38..c5f3ddc 100644 --- a/engine/gf__macro_8h.html +++ b/engine/gf__macro_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__macro_8h_source.html b/engine/gf__macro_8h_source.html index 6df5e70..a7d0fa8 100644 --- a/engine/gf__macro_8h_source.html +++ b/engine/gf__macro_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__math_8c_source.html b/engine/gf__math_8c_source.html index 38e5e94..85ce15d 100644 --- a/engine/gf__math_8c_source.html +++ b/engine/gf__math_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -112,10 +113,10 @@ $(document).ready(function(){initNavTree('gf__math_8c_source.html',''); initResi
12#include <stdlib.h>
13#include <math.h>
14
-
15double gf_math_log2(double x) { return log(x) / log(2); }
+
15double gf_math_log2(double x) { return log(x) / log(2); }
16
- +
17void gf_math_normalize(gf_math_vector_t v) {
18 double x = v[0];
19 double y = v[1];
20 double z = v[2];
@@ -138,21 +139,21 @@ $(document).ready(function(){initNavTree('gf__math_8c_source.html',''); initResi
37
- +
41
-
42 gf_math_subtract(tmp0, v1, v0);
-
43 gf_math_subtract(tmp1, v2, v0);
+
42 gf_math_subtract(tmp0, v1, v0);
+
43 gf_math_subtract(tmp1, v2, v0);
44
-
45 gf_math_multiply(r, tmp0, tmp1);
+
45 gf_math_multiply(r, tmp0, tmp1);
46
- +
47 gf_math_normalize(r);
48}
49
- +
50void gf_math_subtract(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1) {
51 r[0] = v0[0] - v1[0];
52 r[1] = v0[1] - v1[1];
53 r[2] = v0[2] - v1[2];
@@ -160,18 +161,18 @@ $(document).ready(function(){initNavTree('gf__math_8c_source.html',''); initResi
55
- +
56void gf_math_multiply(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1) {
57 r[0] = v0[1] * v1[2] - v0[2] * v1[1];
58 r[1] = v0[2] * v1[0] - v0[0] * v1[2];
59 r[2] = v0[0] * v1[1] - v0[1] * v1[0];
60}
61
-
62double gf_math_cot(double x) { return (double)1 / tan(x); }
+
62double gf_math_cot(double x) { return (double)1 / tan(x); }
63
-
64double gf_math_nearest_2pow(double x) {
-
65 double l = gf_math_log2(x);
+
64double gf_math_nearest_2pow(double x) {
+
65 double l = gf_math_log2(x);
66 double r = pow(2, (int)l);
67 if(x == r) {
68 return r;
@@ -180,13 +181,6 @@ $(document).ready(function(){initNavTree('gf__math_8c_source.html',''); initResi
71}
-
double gf_math_log2(double x)
Calculate log2(x)
Definition gf_math.c:15
-
void gf_math_multiply(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1)
Multiply vector by vector.
Definition gf_math.c:56
-
void gf_math_normalize(gf_math_vector_t v)
Normalize vector.
Definition gf_math.c:17
-
void gf_math_normal(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1, gf_math_vector_t v2)
Calculate normal of triangle v0,v1,v2.
Definition gf_math.c:38
-
void gf_math_subtract(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1)
Subtract vector by vector.
Definition gf_math.c:50
-
double gf_math_cot(double x)
Calculate cot(x)
Definition gf_math.c:62
-
double gf_math_nearest_2pow(double x)
Get nearest 2^n.
Definition gf_math.c:64
Required headers before anything.
Type definitions related to math.
double gf_math_vector_t[4]
Vector.
Definition math.h:25
diff --git a/engine/gf__math_8h.html b/engine/gf__math_8h.html index a684cd5..2cd0829 100644 --- a/engine/gf__math_8h.html +++ b/engine/gf__math_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__math_8h_source.html b/engine/gf__math_8h_source.html index bcaa350..b315e8f 100644 --- a/engine/gf__math_8h_source.html +++ b/engine/gf__math_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__mesh_8c_source.html b/engine/gf__mesh_8c_source.html index f43174d..95e2a1e 100644 --- a/engine/gf__mesh_8c_source.html +++ b/engine/gf__mesh_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__mesh_8h.html b/engine/gf__mesh_8h.html index 81f70ef..f1c46fb 100644 --- a/engine/gf__mesh_8h.html +++ b/engine/gf__mesh_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__mesh_8h_source.html b/engine/gf__mesh_8h_source.html index 034f16b..f2309ef 100644 --- a/engine/gf__mesh_8h_source.html +++ b/engine/gf__mesh_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__miniaudio_8c_source.html b/engine/gf__miniaudio_8c_source.html index d51bc4f..5fd1ea7 100644 --- a/engine/gf__miniaudio_8c_source.html +++ b/engine/gf__miniaudio_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__model_8c_source.html b/engine/gf__model_8c_source.html index 6e9e9cc..803f834 100644 --- a/engine/gf__model_8c_source.html +++ b/engine/gf__model_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__model_8h.html b/engine/gf__model_8h.html index 468f6a0..f5b8ce3 100644 --- a/engine/gf__model_8h.html +++ b/engine/gf__model_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__model_8h_source.html b/engine/gf__model_8h_source.html index 44d1aaa..d489ab4 100644 --- a/engine/gf__model_8h_source.html +++ b/engine/gf__model_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__opengl_8h.html b/engine/gf__opengl_8h.html index 71c9664..c8fd781 100644 --- a/engine/gf__opengl_8h.html +++ b/engine/gf__opengl_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__opengl_8h_source.html b/engine/gf__opengl_8h_source.html index 811725a..995315c 100644 --- a/engine/gf__opengl_8h_source.html +++ b/engine/gf__opengl_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__physics_8c_source.html b/engine/gf__physics_8c_source.html index bcef7ee..d249f6b 100644 --- a/engine/gf__physics_8c_source.html +++ b/engine/gf__physics_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -114,12 +115,12 @@ $(document).ready(function(){initNavTree('gf__physics_8c_source.html',''); initR
14/* Standard */
15#include <stdlib.h>
16
-
17void gf_physics_begin(void) { dInitODE(); }
+
17void gf_physics_begin(void) { dInitODE(); }
18
-
19void gf_physics_end(void) { dCloseODE(); }
+
19void gf_physics_end(void) { dCloseODE(); }
20
- +
21gf_physics_t* gf_physics_create(gf_engine_t* engine) {
22 gf_physics_t* physics = malloc(sizeof(*physics));
23 physics->engine = engine;
24 physics->id = dWorldCreate();
@@ -129,7 +130,7 @@ $(document).ready(function(){initNavTree('gf__physics_8c_source.html',''); initR
28
- +
29void gf_physics_destroy(gf_physics_t* physics) {
30 dWorldDestroy(physics->id);
31 gf_log_function(physics->engine, "Destroyed physics interface", "");
32 free(physics);
@@ -138,10 +139,6 @@ $(document).ready(function(){initNavTree('gf__physics_8c_source.html',''); initR
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
Physics interface.
-
void gf_physics_begin(void)
Initialize physics interface.
Definition gf_physics.c:17
-
void gf_physics_end(void)
Cleanup physics interface.
Definition gf_physics.c:19
-
gf_physics_t * gf_physics_create(gf_engine_t *engine)
Create physics interface.
Definition gf_physics.c:21
-
void gf_physics_destroy(gf_physics_t *physics)
Destroy physics interface.
Definition gf_physics.c:29
Required headers before anything.
Engine instance.
Definition core.h:46
Physics interface.
Definition physics.h:38
diff --git a/engine/gf__physics_8h.html b/engine/gf__physics_8h.html index 8782b5c..9901170 100644 --- a/engine/gf__physics_8h.html +++ b/engine/gf__physics_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__physics_8h_source.html b/engine/gf__physics_8h_source.html index b8377fa..b2c1234 100644 --- a/engine/gf__physics_8h_source.html +++ b/engine/gf__physics_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__pre_8h.html b/engine/gf__pre_8h.html index 4617a63..e65748f 100644 --- a/engine/gf__pre_8h.html +++ b/engine/gf__pre_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__pre_8h_source.html b/engine/gf__pre_8h_source.html index 131c322..07195a7 100644 --- a/engine/gf__pre_8h_source.html +++ b/engine/gf__pre_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__server_8c_source.html b/engine/gf__server_8c_source.html index 2ce43f3..65d6de4 100644 --- a/engine/gf__server_8c_source.html +++ b/engine/gf__server_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -115,19 +116,19 @@ $(document).ready(function(){initNavTree('gf__server_8c_source.html',''); initRe
15#include <stdlib.h>
16#include <string.h>
17
- +
18void gf_server_begin(void) { gf_physics_begin(); }
19
- +
20void gf_server_end(void) { gf_physics_end(); }
21
- +
22gf_server_t* gf_server_create(gf_engine_t* engine) {
23 gf_server_t* server = malloc(sizeof(*server));
24 memset(server, 0, sizeof(*server));
25 server->engine = engine;
-
26 server->physics = gf_physics_create(engine);
+
26 server->physics = gf_physics_create(engine);
27 if(server->physics == NULL) {
28 gf_log_function(engine, "Failed to create physics interface", "");
-
29 gf_server_destroy(server);
+
29 gf_server_destroy(server);
30 return NULL;
31 }
32 return server;
@@ -135,8 +136,8 @@ $(document).ready(function(){initNavTree('gf__server_8c_source.html',''); initRe
34
- -
36 if(server->physics != NULL) gf_physics_destroy(server->physics);
+
35void gf_server_destroy(gf_server_t* server) {
+
36 if(server->physics != NULL) gf_physics_destroy(server->physics);
37 gf_log_function(server->engine, "Destroyed server interface", "");
38 free(server);
39}
@@ -144,16 +145,8 @@ $(document).ready(function(){initNavTree('gf__server_8c_source.html',''); initRe
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
Physics interface.
-
void gf_physics_begin(void)
Initialize physics interface.
Definition gf_physics.c:17
-
void gf_physics_end(void)
Cleanup physics interface.
Definition gf_physics.c:19
-
gf_physics_t * gf_physics_create(gf_engine_t *engine)
Create physics interface.
Definition gf_physics.c:21
-
void gf_physics_destroy(gf_physics_t *physics)
Destroy physics interface.
Definition gf_physics.c:29
Required headers before anything.
Client interface.
-
void gf_server_begin(void)
Initialize server interface.
Definition gf_server.c:18
-
gf_server_t * gf_server_create(gf_engine_t *engine)
Create server interface.
Definition gf_server.c:22
-
void gf_server_end(void)
Cleanup server interface.
Definition gf_server.c:20
-
void gf_server_destroy(gf_server_t *server)
Destroy server interface.
Definition gf_server.c:35
Engine instance.
Definition core.h:46
Server interface.
Definition server.h:38
gf_physics_t * physics
Physics interface.
Definition server.h:38
diff --git a/engine/gf__server_8h.html b/engine/gf__server_8h.html index 86b5ab4..4475fe6 100644 --- a/engine/gf__server_8h.html +++ b/engine/gf__server_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__server_8h_source.html b/engine/gf__server_8h_source.html index 282b435..056c89f 100644 --- a/engine/gf__server_8h_source.html +++ b/engine/gf__server_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__stb__image_8c_source.html b/engine/gf__stb__image_8c_source.html index 5f77a32..18cccbb 100644 --- a/engine/gf__stb__image_8c_source.html +++ b/engine/gf__stb__image_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__texture_8c_source.html b/engine/gf__texture_8c_source.html index 00eb88a..1d091ba 100644 --- a/engine/gf__texture_8c_source.html +++ b/engine/gf__texture_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -115,12 +116,12 @@ $(document).ready(function(){initNavTree('gf__texture_8c_source.html',''); initR
15#include <stdlib.h>
16
-
17gf_texture_t* gf_texture_create(gf_draw_t* draw, int width, int height, unsigned char* data) {
+
17gf_texture_t* gf_texture_create(gf_draw_t* draw, int width, int height, unsigned char* data) {
18 gf_texture_t* texture = malloc(sizeof(*texture));
19 gf_draw_driver_texture_t* ddtexture;
20 texture->internal_width = width;
21 texture->internal_height = height;
-
22 ddtexture = gf_draw_driver_register_texture(draw, width, height, &texture->internal_width, &texture->internal_height, data);
+
22 ddtexture = gf_draw_driver_register_texture(draw, width, height, &texture->internal_width, &texture->internal_height, data);
23 if(ddtexture == NULL) {
24 free(texture);
25 return NULL;
@@ -133,18 +134,14 @@ $(document).ready(function(){initNavTree('gf__texture_8c_source.html',''); initR
32
- - +
33void gf_texture_destroy(gf_texture_t* texture) {
+
34 gf_draw_driver_destroy_texture(texture->draw_driver_texture);
35 free(texture);
36}
Drawing driver.
-
gf_draw_driver_texture_t * gf_draw_driver_register_texture(gf_draw_t *draw, int width, int height, int *iwidth, int *iheight, unsigned char *data)
Register driver-dependent texture.
Definition gf_driver.c:25
-
void gf_draw_driver_destroy_texture(gf_draw_driver_texture_t *texture)
Destroy driver-dependent texture.
Definition gf_driver.c:30
Required headers before anything.
Texture.
-
void gf_texture_destroy(gf_texture_t *texture)
Destroy texture.
Definition gf_texture.c:33
-
gf_texture_t * gf_texture_create(gf_draw_t *draw, int width, int height, unsigned char *data)
Create texture.
Definition gf_texture.c:17
Driver-dependent texture.
Definition draw_driver.h:58
Drawing interface.
Definition draw.h:108
Texture.
Definition texture.h:49
diff --git a/engine/gf__texture_8h.html b/engine/gf__texture_8h.html index 582d398..a07a575 100644 --- a/engine/gf__texture_8h.html +++ b/engine/gf__texture_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__texture_8h_source.html b/engine/gf__texture_8h_source.html index 38c4248..488bd2c 100644 --- a/engine/gf__texture_8h_source.html +++ b/engine/gf__texture_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__thread_8h.html b/engine/gf__thread_8h.html index 2f9529b..e4e6552 100644 --- a/engine/gf__thread_8h.html +++ b/engine/gf__thread_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__thread_8h_source.html b/engine/gf__thread_8h_source.html index be3391a..054b94b 100644 --- a/engine/gf__thread_8h_source.html +++ b/engine/gf__thread_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__version_8c_source.html b/engine/gf__version_8c_source.html index 80f02a4..f725ade 100644 --- a/engine/gf__version_8c_source.html +++ b/engine/gf__version_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -116,7 +117,7 @@ $(document).ready(function(){initNavTree('gf__version_8c_source.html',''); initR
16#define GF_VERSION "1.0.0"
17
- +
18void gf_version_get(gf_version_t* version) {
19 char* cpstr = malloc(512);
20 int i;
21 int incr = 0;
@@ -176,7 +177,6 @@ $(document).ready(function(){initNavTree('gf__version_8c_source.html',''); initR
Required headers before anything.
Version.
-
void gf_version_get(gf_version_t *version)
Get version of engine.
Definition gf_version.c:18
Version.
Definition version.h:68
int major
Major version.
Definition version.h:68
char backend[32]
Name of the rendering backend.
Definition version.h:68
diff --git a/engine/gf__version_8h.html b/engine/gf__version_8h.html index c991c36..3e38bf7 100644 --- a/engine/gf__version_8h.html +++ b/engine/gf__version_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gf__version_8h_source.html b/engine/gf__version_8h_source.html index 1d490a0..3325609 100644 --- a/engine/gf__version_8h_source.html +++ b/engine/gf__version_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/globals.html b/engine/globals.html index e546653..d08e77d 100644 --- a/engine/globals.html +++ b/engine/globals.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/globals_defs.html b/engine/globals_defs.html index f053710..aebdbed 100644 --- a/engine/globals_defs.html +++ b/engine/globals_defs.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/globals_enum.html b/engine/globals_enum.html index 4859604..e8b245b 100644 --- a/engine/globals_enum.html +++ b/engine/globals_enum.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/globals_func.html b/engine/globals_func.html index 3d92b09..fe7db67 100644 --- a/engine/globals_func.html +++ b/engine/globals_func.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/globals_type.html b/engine/globals_type.html index 2c317bb..7a27372 100644 --- a/engine/globals_type.html +++ b/engine/globals_type.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/goldfish.png b/engine/goldfish.png new file mode 100644 index 0000000..a1c5480 Binary files /dev/null and b/engine/goldfish.png differ diff --git a/engine/graphic_8h.html b/engine/graphic_8h.html index 2949f9f..4a625fb 100644 --- a/engine/graphic_8h.html +++ b/engine/graphic_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/graphic_8h_source.html b/engine/graphic_8h_source.html index e6df090..954356e 100644 --- a/engine/graphic_8h_source.html +++ b/engine/graphic_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gui_8h.html b/engine/gui_8h.html index dca0ac0..7894118 100644 --- a/engine/gui_8h.html +++ b/engine/gui_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/gui_8h_source.html b/engine/gui_8h_source.html index 72c8772..762f30a 100644 --- a/engine/gui_8h_source.html +++ b/engine/gui_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/index.html b/engine/index.html index 6ceb843..41ce62d 100644 --- a/engine/index.html +++ b/engine/index.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/input_8h.html b/engine/input_8h.html index bc68b85..b0bce75 100644 --- a/engine/input_8h.html +++ b/engine/input_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/input_8h_source.html b/engine/input_8h_source.html index 52fac48..641c6af 100644 --- a/engine/input_8h_source.html +++ b/engine/input_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/main__console_8c_source.html b/engine/main__console_8c_source.html deleted file mode 100644 index 0cfe30e..0000000 --- a/engine/main__console_8c_source.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - -GoldFish Engine: util/engineinfo/main_console.c Source File - - - - - - - - - - - - - -
-
- - - - - - -
-
GoldFish Engine -
-
Quite simple and lightweight game engine
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
main_console.c
-
-
-
1/* Engine */
-
2#include <gf_version.h>
-
3
-
4/* External library */
-
5
-
6/* Standard */
-
7#include <stdio.h>
-
8
-
9int main(int argc, char** argv) {
-
10 gf_version_t ver;
-
11 gf_version_get(&ver);
-
12
-
13 printf("GoldFish Engine %s\n", ver.full);
-
14 printf("Build Date : %s\n", ver.date);
-
15 printf("Thread model : %s\n", ver.thread);
-
16 printf("Renderer : %s on %s\n", ver.driver, ver.backend);
-
17
-
18 return 0;
-
19}
-
Version.
-
void gf_version_get(gf_version_t *version)
Get version of engine.
Definition gf_version.c:18
-
Version.
Definition version.h:68
-
char backend[32]
Name of the rendering backend.
Definition version.h:68
-
char full[64]
Full version.
Definition version.h:68
-
char driver[32]
Name of the rendering driver.
Definition version.h:68
-
char date[64]
Build date.
Definition version.h:68
-
char thread[32]
Name of the thread model used.
Definition version.h:68
-
-
- - - - diff --git a/engine/main__windows_8c_source.html b/engine/main__windows_8c_source.html deleted file mode 100644 index dd4f7a7..0000000 --- a/engine/main__windows_8c_source.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - - -GoldFish Engine: util/engineinfo/main_windows.c Source File - - - - - - - - - - - - - -
-
- - - - - - -
-
GoldFish Engine -
-
Quite simple and lightweight game engine
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
main_windows.c
-
-
-
1/* Engine */
-
2#include <gf_version.h>
-
3
-
4/* External library */
-
5#include <windows.h>
-
6
-
7/* Standard */
-
8#include <stdio.h>
-
9
-
10#define GUI_BUTTON_OK 1000
-
11
-
12HINSTANCE hInst;
-
13HWND button_ok;
-
14HFONT monospace;
-
15gf_version_t ver;
-
16char vertxt[512];
-
17
-
18void ShowBitmapSize(HWND hWnd, HDC hdc, const char* name, int x, int y, int w, int h) {
-
19 HBITMAP hBitmap = LoadBitmap(hInst, name);
-
20 BITMAP bmp;
-
21 HDC hmdc;
-
22 GetObject(hBitmap, sizeof(bmp), &bmp);
-
23 hmdc = CreateCompatibleDC(hdc);
-
24 SelectObject(hmdc, hBitmap);
-
25 if(w == 0 && h == 0) {
-
26 StretchBlt(hdc, x, y, bmp.bmWidth, bmp.bmHeight, hmdc, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
-
27 } else {
-
28 StretchBlt(hdc, x, y, w, h, hmdc, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
-
29 }
-
30 DeleteDC(hmdc);
-
31 DeleteObject(hBitmap);
-
32}
-
33
-
34LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
-
35 switch(msg) {
-
36 case WM_COMMAND: {
-
37 int trig = LOWORD(wp);
-
38 int ev = HIWORD(wp);
-
39 if(trig == GUI_BUTTON_OK && ev == BN_CLICKED) {
-
40 SendMessage(hWnd, WM_CLOSE, 0, 0);
-
41 }
-
42 break;
-
43 }
-
44 case WM_CLOSE: {
-
45 DestroyWindow(hWnd);
-
46 break;
-
47 }
-
48 case WM_DESTROY: {
-
49 PostQuitMessage(0);
-
50 break;
-
51 }
-
52 case WM_CREATE: {
-
53 RECT rc;
-
54 int sz;
-
55 int width;
-
56 int height;
-
57 int padding;
-
58
-
59 GetClientRect(hWnd, &rc);
-
60 width = rc.right - rc.left;
-
61 height = rc.bottom - rc.top;
-
62 sz = height * 4 / 5;
-
63 padding = height / 2 - sz / 2;
-
64
-
65 monospace = (HFONT)GetStockObject(SYSTEM_FIXED_FONT);
-
66 button_ok = CreateWindow("BUTTON", "&OK", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, width - padding - 40, height - padding - 20, 40, 20, hWnd, (HMENU)GUI_BUTTON_OK, hInst, NULL);
-
67 break;
-
68 }
-
69 case WM_PAINT: {
-
70 HDC hdc;
-
71 PAINTSTRUCT ps;
-
72 RECT rc;
-
73 RECT tx;
-
74 int sz;
-
75 int width;
-
76 int height;
-
77 int padding;
-
78
-
79 GetClientRect(hWnd, &rc);
-
80 width = rc.right - rc.left;
-
81 height = rc.bottom - rc.top;
-
82 sz = height * 4 / 5;
-
83 padding = height / 2 - sz / 2;
-
84
-
85 hdc = BeginPaint(hWnd, &ps);
-
86 SelectObject(hdc, monospace);
-
87 ShowBitmapSize(hWnd, hdc, "GOLDFISH_BMP", padding, padding, sz, sz);
-
88
-
89 tx.left = padding * 2 + sz;
-
90 tx.right = rc.right;
-
91 tx.top = padding;
-
92 tx.bottom = rc.bottom - padding * 2;
-
93 SetBkMode(hdc, TRANSPARENT);
-
94 DrawText(hdc, vertxt, strlen(vertxt), &tx, DT_LEFT);
-
95 EndPaint(hWnd, &ps);
-
96 break;
-
97 }
-
98 default: {
-
99 return DefWindowProc(hWnd, msg, wp, lp);
-
100 }
-
101 }
-
102 return 0;
-
103}
-
104
-
105BOOL InitApp(void) {
-
106 WNDCLASSEX wc;
-
107 wc.cbSize = sizeof(WNDCLASSEX);
-
108 wc.style = CS_HREDRAW | CS_VREDRAW;
-
109 wc.lpfnWndProc = WndProc;
-
110 wc.cbClsExtra = 0;
-
111 wc.cbWndExtra = 0;
-
112 wc.hInstance = hInst;
-
113 wc.hIcon = LoadIcon(hInst, "GAME");
-
114 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
-
115 wc.hbrBackground = GetSysColorBrush(COLOR_MENU);
-
116 wc.lpszMenuName = NULL;
-
117 wc.lpszClassName = "nishbox";
-
118 wc.hIconSm = LoadIcon(hInst, "GAME");
-
119 return RegisterClassEx(&wc);
-
120}
-
121
-
122BOOL InitWindow(int nCmdShow) {
-
123 HWND hWnd;
-
124 RECT deskrc, rc;
-
125 HWND hDeskWnd = GetDesktopWindow();
-
126 GetWindowRect(hDeskWnd, &deskrc);
-
127 hWnd = CreateWindow("nishbox", "GoldFish Engine Info", (WS_OVERLAPPEDWINDOW ^ WS_THICKFRAME) ^ WS_MAXIMIZEBOX, 0, 0, 500, 250, NULL, 0, hInst, NULL);
-
128
-
129 if(!hWnd) {
-
130 return FALSE;
-
131 }
-
132 GetWindowRect(hWnd, &rc);
-
133 SetWindowPos(hWnd, HWND_TOP, (deskrc.right - (rc.right - rc.left)) / 2, (deskrc.bottom - (rc.bottom - rc.top)) / 2, rc.right - rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW);
-
134 ShowWindow(hWnd, nCmdShow);
-
135 UpdateWindow(hWnd);
-
136 return TRUE;
-
137}
-
138
-
139int WINAPI WinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst, LPSTR lpsCmdLine, int nCmdShow) {
-
140 MSG msg;
-
141 BOOL bret;
-
142
-
143 hInst = hCurInst;
-
144
-
145 gf_version_get(&ver);
-
146 vertxt[0] = 0;
-
147 sprintf(vertxt + strlen(vertxt), "GoldFish Engine %s\n", ver.full);
-
148 sprintf(vertxt + strlen(vertxt), "Build Date : %s\n", ver.date);
-
149 sprintf(vertxt + strlen(vertxt), "Thread Model : %s\n", ver.thread);
-
150 sprintf(vertxt + strlen(vertxt), "Renderer : %s on %s\n", ver.driver, ver.backend);
-
151
-
152 if(!InitApp()) {
-
153 return FALSE;
-
154 }
-
155
-
156 if(!InitWindow(nCmdShow)) {
-
157 return FALSE;
-
158 }
-
159
-
160 while((bret = GetMessage(&msg, NULL, 0, 0)) != 0) {
-
161 if(bret == -1) {
-
162 break;
-
163 } else {
-
164 TranslateMessage(&msg);
-
165 DispatchMessage(&msg);
-
166 }
-
167 }
-
168
-
169 return (int)msg.wParam;
-
170}
-
Version.
-
void gf_version_get(gf_version_t *version)
Get version of engine.
Definition gf_version.c:18
-
Version.
Definition version.h:68
-
char backend[32]
Name of the rendering backend.
Definition version.h:68
-
char full[64]
Full version.
Definition version.h:68
-
char driver[32]
Name of the rendering driver.
Definition version.h:68
-
char date[64]
Build date.
Definition version.h:68
-
char thread[32]
Name of the thread model used.
Definition version.h:68
-
-
- - - - diff --git a/engine/math_8h.html b/engine/math_8h.html index 8815e52..b72b781 100644 --- a/engine/math_8h.html +++ b/engine/math_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/math_8h_source.html b/engine/math_8h_source.html index c0432de..fe91b58 100644 --- a/engine/math_8h_source.html +++ b/engine/math_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/mesh_8h.html b/engine/mesh_8h.html index 68c180c..5bacd39 100644 --- a/engine/mesh_8h.html +++ b/engine/mesh_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/mesh_8h_source.html b/engine/mesh_8h_source.html index 66da728..699f871 100644 --- a/engine/mesh_8h_source.html +++ b/engine/mesh_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/model_8h.html b/engine/model_8h.html index f823353..af158ef 100644 --- a/engine/model_8h.html +++ b/engine/model_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/model_8h_source.html b/engine/model_8h_source.html index fcd2043..11023f7 100644 --- a/engine/model_8h_source.html +++ b/engine/model_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/navtreedata.js b/engine/navtreedata.js index 39cae6b..4e72da7 100644 --- a/engine/navtreedata.js +++ b/engine/navtreedata.js @@ -50,7 +50,7 @@ var NAVTREE = var NAVTREEINDEX = [ "annotated.html", -"math_8h_source.html" +"model_8h_source.html" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/engine/navtreeindex0.js b/engine/navtreeindex0.js index 3f3122d..ba98e54 100644 --- a/engine/navtreeindex0.js +++ b/engine/navtreeindex0.js @@ -14,9 +14,7 @@ var NAVTREEINDEX0 = "dir_0d98df33664112e13024255ca1b098d2.html":[2,0,1,1,1,0], "dir_1d6203c8371f8f7ecbd9e9230894d473.html":[2,0,1,1,0], "dir_22f649445e791bda7c2b14c78388b946.html":[2,0,1,1,1,1], -"dir_23ec12649285f9fabf3a6b7380226c28.html":[2,0,2], "dir_546733639134b9431ef34ac72f6d1288.html":[2,0,1,1], -"dir_564eac3fbd1641f0d7f53b584187d9ce.html":[2,0,2,0], "dir_599f4bc7262791fc6e619beabec41e32.html":[2,0,1,2,0], "dir_6684fa0b48800166488fdb25c8e1a946.html":[2,0,1,2,1], "dir_68267d1309a1af8e8297ef4c3efbcdba.html":[2,0,1], @@ -246,8 +244,10 @@ var NAVTREEINDEX0 = "input_8h.html#a9e633a7c5d0bd577a11243b397354588":[2,0,0,0,10,1], "input_8h.html#aa131fcdb7b5d6864c62b32b86f702962":[2,0,0,0,10,3], "input_8h_source.html":[2,0,0,0,10], -"main__console_8c_source.html":[2,0,2,0,0], -"main__windows_8c_source.html":[2,0,2,0,1], "math_8h.html":[2,0,0,0,11], -"math_8h.html#a866f43b3ea5386cb9497738f1eec3d88":[2,0,0,0,11,0] +"math_8h.html#a866f43b3ea5386cb9497738f1eec3d88":[2,0,0,0,11,0], +"math_8h_source.html":[2,0,0,0,11], +"mesh_8h.html":[2,0,0,0,12], +"mesh_8h_source.html":[2,0,0,0,12], +"model_8h.html":[2,0,0,0,13] }; diff --git a/engine/navtreeindex1.js b/engine/navtreeindex1.js index c42cbbe..2b9b494 100644 --- a/engine/navtreeindex1.js +++ b/engine/navtreeindex1.js @@ -1,9 +1,5 @@ var NAVTREEINDEX1 = { -"math_8h_source.html":[2,0,0,0,11], -"mesh_8h.html":[2,0,0,0,12], -"mesh_8h_source.html":[2,0,0,0,12], -"model_8h.html":[2,0,0,0,13], "model_8h_source.html":[2,0,0,0,13], "opengl_2gf__driver_8c_source.html":[2,0,1,1,1,3], "opengl_2gf__graphic_8c_source.html":[2,0,1,1,1,4], diff --git a/engine/opengl_2gf__driver_8c_source.html b/engine/opengl_2gf__driver_8c_source.html index f07654b..8c77b05 100644 --- a/engine/opengl_2gf__driver_8c_source.html +++ b/engine/opengl_2gf__driver_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -127,10 +128,10 @@ $(document).ready(function(){initNavTree('opengl_2gf__driver_8c_source.html','')
27GLfloat lightdim[] = {0.2f, 0.2f, 0.2f, 1.0f};
28GLfloat lightblk[] = {0.0f, 0.0f, 0.0f, 1.0f};
29
-
30gf_draw_driver_texture_t* gf_draw_driver_register_texture(gf_draw_t* draw, int width, int height, int* iwidth, int* iheight, unsigned char* data) {
+
30gf_draw_driver_texture_t* gf_draw_driver_register_texture(gf_draw_t* draw, int width, int height, int* iwidth, int* iheight, unsigned char* data) {
31 gf_draw_driver_texture_t* r = malloc(sizeof(*r));
-
32 int w = gf_math_nearest_2pow(width);
-
33 int h = gf_math_nearest_2pow(height);
+
32 int w = gf_math_nearest_2pow(width);
+
33 int h = gf_math_nearest_2pow(height);
34 int x, y;
35 unsigned char* d = malloc(w * h * 4);
36
@@ -160,12 +161,12 @@ $(document).ready(function(){initNavTree('opengl_2gf__driver_8c_source.html','')
60 return r;
61}
62
- +
63void gf_draw_driver_destroy_texture(gf_draw_driver_texture_t* t) {
64 glDeleteTextures(1, &t->id);
65 free(t);
66}
67
- +
68gf_draw_driver_t* gf_draw_driver_create(gf_engine_t* engine, gf_draw_t* draw) {
69 gf_draw_driver_t* draw_driver = malloc(sizeof(*draw_driver));
70 memset(draw_driver, 0, sizeof(*draw_driver));
71 draw_driver->engine = engine;
@@ -198,8 +199,8 @@ $(document).ready(function(){initNavTree('opengl_2gf__driver_8c_source.html','')
98 return draw_driver;
99}
100
-
101int gf_draw_driver_has_extension(gf_draw_t* draw, const char* query) {
-
102 int ret = gf_draw_platform_has_extension(draw, query);
+
101int gf_draw_driver_has_extension(gf_draw_t* draw, const char* query) {
+
102 int ret = gf_draw_platform_has_extension(draw, query);
103 const char* ext = NULL;
104 const char* ptr;
105 const int len = strlen(query);
@@ -210,70 +211,54 @@ $(document).ready(function(){initNavTree('opengl_2gf__driver_8c_source.html','')
110 return ((ptr != NULL) && ((ptr[len] == ' ') || (ptr[len] == '\0')));
111}
112
- +
113void gf_draw_driver_reshape(gf_draw_t* draw) {
114 glViewport(0, 0, (GLint)draw->width, (GLint)draw->height);
115 glMatrixMode(GL_PROJECTION);
-
116 gf_graphic_perspective(draw, 30, 1.0, 1000.0);
+
116 gf_graphic_perspective(draw, 30, 1.0, 1000.0);
117
118 glMatrixMode(GL_MODELVIEW);
119 glLoadIdentity();
120}
121
- +
122void gf_draw_driver_begin_texture_2d(gf_draw_t* draw, gf_texture_t* texture) {
123 glEnable(GL_TEXTURE_2D);
124 glBindTexture(GL_TEXTURE_2D, texture->draw_driver_texture->id);
125}
126
- +
127void gf_draw_driver_end_texture_2d(gf_draw_t* draw) {
128 glDisable(GL_TEXTURE_2D);
129 glBindTexture(GL_TEXTURE_2D, 0);
130}
131
-
132void gf_draw_driver_set_color(gf_draw_t* draw, gf_graphic_color_t color) { glColor4f(color.r / 255, color.g / 255, color.b / 255, color.a / 255); }
+
132void gf_draw_driver_set_color(gf_draw_t* draw, gf_graphic_color_t color) { glColor4f(color.r / 255, color.g / 255, color.b / 255, color.a / 255); }
133
- +
134void gf_draw_driver_destroy(gf_draw_driver_t* driver) {
135 gf_log_function(driver->engine, "Destroyed drawing driver", "");
136 free(driver);
137}
138
- +
139void gf_draw_driver_before(gf_draw_t* draw) {
140 GLfloat lightpos[4];
141 GF_MATH_VECTOR_COPY(draw->light, lightpos);
142 lightpos[3] = draw->light[3];
143
- +
144 gf_draw_driver_reshape(draw);
145
- +
146 gf_graphic_set_camera(draw);
147
148 glLightfv(GL_LIGHT0, GL_POSITION, lightpos);
-
149 gf_graphic_clear(draw);
+
149 gf_graphic_clear(draw);
150}
151
-
152void gf_draw_driver_after(gf_draw_t* draw) { glFlush(); }
+
152void gf_draw_driver_after(gf_draw_t* draw) { glFlush(); }
Drawing interface.
Drawing driver.
-
gf_draw_driver_texture_t * gf_draw_driver_register_texture(gf_draw_t *draw, int width, int height, int *iwidth, int *iheight, unsigned char *data)
Register driver-dependent texture.
Definition gf_driver.c:25
-
void gf_draw_driver_set_color(gf_draw_t *draw, gf_graphic_color_t color)
Set color.
Definition gf_driver.c:53
-
void gf_draw_driver_end_texture_2d(gf_draw_t *draw)
End 2D texture mode.
Definition gf_driver.c:51
-
void gf_draw_driver_before(gf_draw_t *draw)
Called before gf_draw_frame.
Definition gf_driver.c:61
-
void gf_draw_driver_after(gf_draw_t *draw)
Called after gf_draw_frame.
Definition gf_driver.c:71
-
int gf_draw_driver_has_extension(gf_draw_t *draw, const char *query)
Check if renderer has extension.
Definition gf_driver.c:45
-
void gf_draw_driver_destroy_texture(gf_draw_driver_texture_t *texture)
Destroy driver-dependent texture.
Definition gf_driver.c:30
-
void gf_draw_driver_begin_texture_2d(gf_draw_t *draw, gf_texture_t *texture)
Begin 2D texture mode.
Definition gf_driver.c:49
-
gf_draw_driver_t * gf_draw_driver_create(gf_engine_t *engine, gf_draw_t *draw)
Initialize drawing driver.
Definition gf_driver.c:35
-
void gf_draw_driver_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
Definition gf_driver.c:47
-
void gf_draw_driver_destroy(gf_draw_driver_t *driver)
Destroy drawing driver.
Definition gf_driver.c:55
Platform-dependent part of drawing driver.
-
int gf_draw_platform_has_extension(gf_draw_t *draw, const char *query)
Check if renderer has extension.
Definition gf_draw.c:99
Graphic interface.
-
void gf_graphic_clear(gf_draw_t *draw)
Clear the screen.
Definition gf_graphic.c:26
-
void gf_graphic_perspective(gf_draw_t *draw, double fovy, double znear, double zfar)
Set perspective.
Definition gf_graphic.c:32
-
void gf_graphic_set_camera(gf_draw_t *draw)
Set camera.
Definition gf_graphic.c:34
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
#define GF_MATH_VECTOR_COPY(from, to)
Copy vector.
Definition gf_math.h:32
-
double gf_math_nearest_2pow(double x)
Get nearest 2^n.
Definition gf_math.c:64
OpenGL headers.
Required headers before anything.
Texture.
diff --git a/engine/opengl_2gf__graphic_8c_source.html b/engine/opengl_2gf__graphic_8c_source.html index f69faff..410f5ca 100644 --- a/engine/opengl_2gf__graphic_8c_source.html +++ b/engine/opengl_2gf__graphic_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -119,7 +120,7 @@ $(document).ready(function(){initNavTree('opengl_2gf__graphic_8c_source.html',''
19#include <stdarg.h>
20#include <stdio.h>
21
- +
22void gf_graphic_begin_2d(gf_draw_t* draw) {
23 glDisable(GL_LIGHTING);
24 glDisable(GL_DEPTH_TEST);
25 glMatrixMode(GL_PROJECTION);
@@ -131,7 +132,7 @@ $(document).ready(function(){initNavTree('opengl_2gf__graphic_8c_source.html',''
31 glLoadIdentity();
32}
33
-
34void gf_graphic_end_2d(gf_draw_t* draw) {
+
34void gf_graphic_end_2d(gf_draw_t* draw) {
35 glMatrixMode(GL_MODELVIEW);
36 glPopMatrix();
37 glMatrixMode(GL_PROJECTION);
@@ -141,19 +142,19 @@ $(document).ready(function(){initNavTree('opengl_2gf__graphic_8c_source.html',''
41 glEnable(GL_LIGHTING);
42}
43
-
44void gf_graphic_clear(gf_draw_t* draw) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); }
+
44void gf_graphic_clear(gf_draw_t* draw) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); }
45
-
46void gf_graphic_draw_texture_polygon(gf_draw_t* draw, gf_texture_t* texture, gf_graphic_color_t color, int dim, int npair, ...) {
+
46void gf_graphic_draw_texture_polygon(gf_draw_t* draw, gf_texture_t* texture, gf_graphic_color_t color, int dim, int npair, ...) {
47 double tw = (double)texture->width / texture->internal_width;
48 double th = (double)texture->height / texture->internal_height;
49 int i;
50 va_list va;
51 va_start(va, npair);
52
-
53 if(dim == 2) gf_graphic_begin_2d(draw);
- +
53 if(dim == 2) gf_graphic_begin_2d(draw);
+
54 gf_draw_driver_begin_texture_2d(draw, texture);
55
-
56 gf_draw_driver_set_color(draw, color);
+
56 gf_draw_driver_set_color(draw, color);
57 glBegin(GL_TRIANGLE_FAN);
58
59 for(i = 0; i < npair; i++) {
@@ -172,20 +173,20 @@ $(document).ready(function(){initNavTree('opengl_2gf__graphic_8c_source.html',''
72
73 glEnd();
74
- -
76 if(dim == 2) gf_graphic_end_2d(draw);
+
75 gf_draw_driver_end_texture_2d(draw);
+
76 if(dim == 2) gf_graphic_end_2d(draw);
77
78 va_end(va);
79}
80
-
81void gf_graphic_fill_polygon(gf_draw_t* draw, gf_graphic_color_t color, int dim, int npair, ...) {
+
81void gf_graphic_fill_polygon(gf_draw_t* draw, gf_graphic_color_t color, int dim, int npair, ...) {
82 int i;
83 va_list va;
84 va_start(va, npair);
85
-
86 if(dim == 2) gf_graphic_begin_2d(draw);
+
86 if(dim == 2) gf_graphic_begin_2d(draw);
87
-
88 gf_draw_driver_set_color(draw, color);
+
88 gf_draw_driver_set_color(draw, color);
89 glBegin(GL_TRIANGLE_FAN);
90
91 for(i = 0; i < npair; i++) {
@@ -200,14 +201,14 @@ $(document).ready(function(){initNavTree('opengl_2gf__graphic_8c_source.html',''
100 }
101
102 glEnd();
-
103 if(dim == 2) gf_graphic_end_2d(draw);
+
103 if(dim == 2) gf_graphic_end_2d(draw);
104
105 va_end(va);
106}
107
-
108void gf_graphic_perspective(gf_draw_t* draw, double fovy, double znear, double zfar) {
+
108void gf_graphic_perspective(gf_draw_t* draw, double fovy, double znear, double zfar) {
109 double aspect = (double)draw->width / (double)draw->height;
-
110 double f = gf_math_cot(fovy / 180 * GF_MATH_PI / 2);
+
110 double f = gf_math_cot(fovy / 180 * GF_MATH_PI / 2);
111 GLdouble matrix[16];
112 int i;
113
@@ -222,7 +223,7 @@ $(document).ready(function(){initNavTree('opengl_2gf__graphic_8c_source.html',''
122 glLoadMatrixd(matrix);
123}
124
- +
125GF_EXPORT void gf_graphic_set_camera(gf_draw_t* draw) {
126 GLdouble matrix[16];
@@ -233,17 +234,17 @@ $(document).ready(function(){initNavTree('opengl_2gf__graphic_8c_source.html',''
133 f[0] = draw->lookat[0] - draw->camera[0];
134 f[1] = draw->lookat[1] - draw->camera[1];
135 f[2] = draw->lookat[2] - draw->camera[2];
- +
136 gf_math_normalize(f);
137
138 up[0] = 0;
139 up[1] = 1;
140 up[2] = 0;
- +
141 gf_math_normalize(up);
142
-
143 gf_math_multiply(s, f, up);
- +
143 gf_math_multiply(s, f, up);
+
144 gf_math_normalize(s);
145
-
146 gf_math_multiply(u, s, f);
+
146 gf_math_multiply(u, s, f);
147
148 for(i = 0; i < 16; i++) matrix[i] = 0;
149 matrix[4 * 0 + 0] = s[0];
@@ -263,25 +264,12 @@ $(document).ready(function(){initNavTree('opengl_2gf__graphic_8c_source.html',''
163}
Drawing interface.
Drawing driver.
-
void gf_draw_driver_set_color(gf_draw_t *draw, gf_graphic_color_t color)
Set color.
Definition gf_driver.c:53
-
void gf_draw_driver_end_texture_2d(gf_draw_t *draw)
End 2D texture mode.
Definition gf_driver.c:51
-
void gf_draw_driver_begin_texture_2d(gf_draw_t *draw, gf_texture_t *texture)
Begin 2D texture mode.
Definition gf_driver.c:49
Graphic interface.
#define GF_GRAPHIC_3D
Dimension parameter for 3D.
Definition gf_graphic.h:32
-
void gf_graphic_draw_texture_polygon(gf_draw_t *draw, gf_texture_t *texture, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon with texture.
Definition gf_graphic.c:28
-
void gf_graphic_clear(gf_draw_t *draw)
Clear the screen.
Definition gf_graphic.c:26
-
void gf_graphic_fill_polygon(gf_draw_t *draw, gf_graphic_color_t color, int dim, int npair,...)
Draw polygon.
Definition gf_graphic.c:30
-
void gf_graphic_perspective(gf_draw_t *draw, double fovy, double znear, double zfar)
Set perspective.
Definition gf_graphic.c:32
#define GF_GRAPHIC_2D
Dimension parameter for 2D.
Definition gf_graphic.h:26
-
void gf_graphic_end_2d(gf_draw_t *draw)
End 2D mode.
Definition gf_graphic.c:24
-
void gf_graphic_begin_2d(gf_draw_t *draw)
Start 2D mode.
Definition gf_graphic.c:22
-
void gf_graphic_set_camera(gf_draw_t *draw)
Set camera.
Definition gf_graphic.c:34
#define GF_EXPORT
Macro for platform-dependent symbol export/import.
Definition gf_macro.h:190
-
void gf_math_multiply(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1)
Multiply vector by vector.
Definition gf_math.c:56
-
void gf_math_normalize(gf_math_vector_t v)
Normalize vector.
Definition gf_math.c:17
#define GF_MATH_PI
Pi.
Definition gf_math.h:24
-
double gf_math_cot(double x)
Calculate cot(x)
Definition gf_math.c:62
OpenGL headers.
Required headers before anything.
Texture.
diff --git a/engine/opengl_2glfw_2gf__draw_8c_source.html b/engine/opengl_2glfw_2gf__draw_8c_source.html index 83e71c4..323f7f2 100644 --- a/engine/opengl_2glfw_2gf__draw_8c_source.html +++ b/engine/opengl_2glfw_2gf__draw_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -120,7 +121,7 @@ $(document).ready(function(){initNavTree('opengl_2glfw_2gf__draw_8c_source.html'
20#include <string.h>
21#include <stdlib.h>
22
-
23void gf_draw_platform_begin(void) {
+
23void gf_draw_platform_begin(void) {
24 glfwInit();
25 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 1);
26 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
@@ -128,14 +129,14 @@ $(document).ready(function(){initNavTree('opengl_2glfw_2gf__draw_8c_source.html'
28 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
29}
30
-
31void gf_draw_platform_end(void) {}
+
31void gf_draw_platform_end(void) {}
32
33void gf_glfw_size(GLFWwindow* window, int w, int h) {
34 gf_draw_t* draw = (gf_draw_t*)glfwGetWindowUserPointer(window);
35 draw->width = w;
36 draw->height = h;
37 glfwSetWindowSize(window, w, h);
-
38 gf_draw_reshape(draw);
+
38 gf_draw_reshape(draw);
39}
40
41void gf_glfw_button(GLFWwindow* window, int button, int action, int mods) {
@@ -160,7 +161,7 @@ $(document).ready(function(){initNavTree('opengl_2glfw_2gf__draw_8c_source.html'
60 }
61}
62
-
63int gf_draw_platform_has_extension(gf_draw_t* draw, const char* query) {
+
63int gf_draw_platform_has_extension(gf_draw_t* draw, const char* query) {
64 const char* ext = NULL;
65 const char* ptr;
66 const int len = strlen(query);
@@ -170,7 +171,7 @@ $(document).ready(function(){initNavTree('opengl_2glfw_2gf__draw_8c_source.html'
70 return glfwExtensionSupported(query);
71}
72
- +
73int gf_draw_platform_step(gf_draw_t* draw) {
74 int ret = 0;
75 int w, h;
76 glfwMakeContextCurrent(draw->platform->window);
@@ -178,16 +179,16 @@ $(document).ready(function(){initNavTree('opengl_2glfw_2gf__draw_8c_source.html'
78 if(draw->close) glfwSetWindowShouldClose(draw->platform->window, GLFW_FALSE);
79 glfwPollEvents();
80 if(ret == 0) {
- -
82 gf_draw_frame(draw);
- +
81 gf_draw_driver_before(draw);
+
82 gf_draw_frame(draw);
+
83 gf_draw_driver_after(draw);
84
85 glfwSwapBuffers(draw->platform->window);
86 }
87 return ret;
88}
89
- +
90gf_draw_platform_t* gf_draw_platform_create(gf_engine_t* engine, gf_draw_t* draw) {
91 gf_draw_platform_t* platform = malloc(sizeof(*platform));
92 memset(platform, 0, sizeof(*platform));
93 platform->engine = engine;
@@ -195,7 +196,7 @@ $(document).ready(function(){initNavTree('opengl_2glfw_2gf__draw_8c_source.html'
95 platform->window = glfwCreateWindow(draw->width, draw->height, draw->title, NULL, NULL);
96 if(platform->window == NULL) {
97 gf_log_function(engine, "Failed to create window", "");
- +
98 gf_draw_platform_destroy(platform);
99 return NULL;
100 }
101
@@ -211,7 +212,7 @@ $(document).ready(function(){initNavTree('opengl_2glfw_2gf__draw_8c_source.html'
111 return platform;
112}
113
- +
114void gf_draw_platform_destroy(gf_draw_platform_t* platform) {
115 if(platform->window != NULL) {
116 glfwDestroyWindow(platform->window);
117 }
@@ -219,18 +220,8 @@ $(document).ready(function(){initNavTree('opengl_2glfw_2gf__draw_8c_source.html'
119 free(platform);
120}
Drawing interface.
-
void gf_draw_frame(gf_draw_t *draw)
Draw frame (common part)
-
void gf_draw_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
Drawing driver.
-
void gf_draw_driver_before(gf_draw_t *draw)
Called before gf_draw_frame.
Definition gf_driver.c:61
-
void gf_draw_driver_after(gf_draw_t *draw)
Called after gf_draw_frame.
Definition gf_driver.c:71
Platform-dependent part of drawing driver.
-
void gf_draw_platform_destroy(gf_draw_platform_t *platform)
Destroy platform-dependent part of drawing driver.
Definition gf_draw.c:179
-
int gf_draw_platform_has_extension(gf_draw_t *draw, const char *query)
Check if renderer has extension.
Definition gf_draw.c:99
-
void gf_draw_platform_begin(void)
Initialize platform-dependent part of drawing driver.
Definition gf_draw.c:23
-
void gf_draw_platform_end(void)
Cleanup platform-dependent part of drawing driver.
Definition gf_draw.c:24
-
gf_draw_platform_t * gf_draw_platform_create(gf_engine_t *engine, gf_draw_t *draw)
Create platform-dependent part of drawing driver.
Definition gf_draw.c:123
-
int gf_draw_platform_step(gf_draw_t *draw)
Do platform-dependent step.
Definition gf_draw.c:101
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
diff --git a/engine/opengl_2glx_2gf__draw_8c_source.html b/engine/opengl_2glx_2gf__draw_8c_source.html index 98dc89d..7417f49 100644 --- a/engine/opengl_2glx_2gf__draw_8c_source.html +++ b/engine/opengl_2glx_2gf__draw_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -138,10 +139,10 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
38#endif
39#endif
40
-
41void gf_draw_platform_begin(void) {}
-
42void gf_draw_platform_end(void) {}
+
41void gf_draw_platform_begin(void) {}
+
42void gf_draw_platform_end(void) {}
43
-
44int gf_draw_platform_has_extension(gf_draw_t* draw, const char* query) {
+
44int gf_draw_platform_has_extension(gf_draw_t* draw, const char* query) {
45 const char* ext = NULL;
46 const char* ptr;
47 const int len = strlen(query);
@@ -153,7 +154,7 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
53 return ((ptr != NULL) && ((ptr[len] == ' ') || (ptr[len] == '\0')));
54}
55
- +
56gf_draw_platform_t* gf_draw_platform_create(gf_engine_t* engine, gf_draw_t* draw) {
57 int i = 0;
58 int attribs[64];
59 int screen;
@@ -169,7 +170,7 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
69 platform->display = XOpenDisplay(NULL);
70 if(platform->display == NULL) {
71 gf_log_function(engine, "Failed to open display", "");
- +
72 gf_draw_platform_destroy(platform);
73 return NULL;
74 }
75 attribs[i++] = GLX_RGBA;
@@ -192,7 +193,7 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
92 visual = glXChooseVisual(platform->display, screen, attribs);
93 if(visual == NULL) {
94 gf_log_function(engine, "Failed to get visual", "");
- +
95 gf_draw_platform_destroy(platform);
96 return NULL;
97 }
98
@@ -215,7 +216,7 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
115 if(platform->context == NULL) {
116 XFree(visual);
117 gf_log_function(engine, "Failed to get OpenGL context", "");
-
118 gf_draw_platform_destroy(platform);
+
118 gf_draw_platform_destroy(platform);
119 return NULL;
120 }
121
@@ -225,7 +226,7 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
125 glXMakeCurrent(platform->display, platform->window, platform->context);
126
127#ifdef DO_SWAP_INTERVAL
-
128 if(gf_draw_platform_has_extension(draw, "GLX_EXT_swap_control")) {
+
128 if(gf_draw_platform_has_extension(draw, "GLX_EXT_swap_control")) {
129 unsigned int tmp = -1;
130 PFNGLXSWAPINTERVALEXTPROC proc = (PFNGLXSWAPINTERVALEXTPROC)glXGetProcAddressARB("glXSwapIntervalEXT");
131 if(proc != NULL) {
@@ -233,14 +234,14 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
133 }
134 glXQueryDrawable(platform->display, platform->window, GLX_SWAP_INTERVAL_EXT, &tmp);
135 interval = tmp;
-
136 } else if(gf_draw_platform_has_extension(draw, "GLX_MESA_swap_control")) {
+
136 } else if(gf_draw_platform_has_extension(draw, "GLX_MESA_swap_control")) {
137 PFNGLXGETSWAPINTERVALMESAPROC proc = (PFNGLXGETSWAPINTERVALMESAPROC)glXGetProcAddressARB("glXGetSwapIntervalMESA");
138 PFNGLXSWAPINTERVALMESAPROC proc2 = (PFNGLXSWAPINTERVALMESAPROC)glXGetProcAddressARB("glXSwapIntervalMESA");
139 if(proc2 != NULL) {
140 proc2(1);
141 }
142 interval = proc();
-
143 } else if(gf_draw_platform_has_extension(draw, "GLX_SGI_swap_control")) {
+
143 } else if(gf_draw_platform_has_extension(draw, "GLX_SGI_swap_control")) {
144 PFNGLXSWAPINTERVALSGIPROC proc = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddressARB("glXSwapIntervalSGI");
145 proc(1);
146 interval = 1;
@@ -252,7 +253,7 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
152 return platform;
153}
154
- +
155int gf_draw_platform_step(gf_draw_t* draw) {
156 int ret = 0;
157 glXMakeCurrent(draw->platform->display, draw->platform->window, draw->platform->context);
158 while(XPending(draw->platform->display) > 0) {
@@ -271,7 +272,7 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
171 draw->width = event.xconfigure.width;
172 draw->height = event.xconfigure.height;
173 glXMakeCurrent(draw->platform->display, draw->platform->window, draw->platform->context);
-
174 gf_draw_reshape(draw);
+
174 gf_draw_reshape(draw);
175 } else if(event.type == ButtonPress) {
176 if(draw->input != NULL) {
177 if(event.xbutton.button == Button1) draw->input->mouse_flag |= GF_INPUT_MOUSE_LEFT_MASK;
@@ -292,16 +293,16 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
192 }
193 }
194 if(ret == 0) {
- -
196 gf_draw_frame(draw);
- +
195 gf_draw_driver_before(draw);
+
196 gf_draw_frame(draw);
+
197 gf_draw_driver_after(draw);
198
199 glXSwapBuffers(draw->platform->display, draw->platform->window);
200 }
201 return ret;
202}
203
- +
204void gf_draw_platform_destroy(gf_draw_platform_t* platform) {
205 if(platform->context != NULL) {
206 glXMakeCurrent(platform->display, None, NULL);
207 glXDestroyContext(platform->display, platform->context);
@@ -314,18 +315,8 @@ $(document).ready(function(){initNavTree('opengl_2glx_2gf__draw_8c_source.html',
214 free(platform);
215}
Drawing interface.
-
void gf_draw_frame(gf_draw_t *draw)
Draw frame (common part)
-
void gf_draw_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
Drawing driver.
-
void gf_draw_driver_before(gf_draw_t *draw)
Called before gf_draw_frame.
Definition gf_driver.c:61
-
void gf_draw_driver_after(gf_draw_t *draw)
Called after gf_draw_frame.
Definition gf_driver.c:71
Platform-dependent part of drawing driver.
-
void gf_draw_platform_destroy(gf_draw_platform_t *platform)
Destroy platform-dependent part of drawing driver.
Definition gf_draw.c:179
-
int gf_draw_platform_has_extension(gf_draw_t *draw, const char *query)
Check if renderer has extension.
Definition gf_draw.c:99
-
void gf_draw_platform_begin(void)
Initialize platform-dependent part of drawing driver.
Definition gf_draw.c:23
-
void gf_draw_platform_end(void)
Cleanup platform-dependent part of drawing driver.
Definition gf_draw.c:24
-
gf_draw_platform_t * gf_draw_platform_create(gf_engine_t *engine, gf_draw_t *draw)
Create platform-dependent part of drawing driver.
Definition gf_draw.c:123
-
int gf_draw_platform_step(gf_draw_t *draw)
Do platform-dependent step.
Definition gf_draw.c:101
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
diff --git a/engine/opengl_2wgl_2gf__draw_8c_source.html b/engine/opengl_2wgl_2gf__draw_8c_source.html index 6a57f30..5ac59a8 100644 --- a/engine/opengl_2wgl_2gf__draw_8c_source.html +++ b/engine/opengl_2wgl_2gf__draw_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -125,8 +126,8 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
25typedef BOOL(APIENTRY* PFNWGLSWAPINTERVALPROC)(int);
26#endif
27
-
28void gf_draw_platform_begin(void) {}
-
29void gf_draw_platform_end(void) {}
+
28void gf_draw_platform_begin(void) {}
+
29void gf_draw_platform_end(void) {}
30
31LRESULT CALLBACK gf_draw_platform_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
32 PAINTSTRUCT ps;
@@ -145,7 +146,7 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
45 draw->width = rect.right - rect.left;
46 draw->height = rect.bottom - rect.top;
47 wglMakeCurrent(draw->platform->dc, draw->platform->glrc);
-
48 gf_draw_reshape(draw);
+
48 gf_draw_reshape(draw);
49 }
50 break;
51 case WM_MOUSEMOVE:
@@ -202,7 +203,7 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
102 return 0;
103}
104
-
105int gf_draw_platform_has_extension(gf_draw_t* draw, const char* query) {
+
105int gf_draw_platform_has_extension(gf_draw_t* draw, const char* query) {
106 const char* ext = NULL;
107 const char* ptr;
108 const int len = strlen(query);
@@ -220,7 +221,7 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
120 return 0;
121}
122
- +
123int gf_draw_platform_step(gf_draw_t* draw) {
124 MSG msg;
125 int ret = 0;
126 wglMakeCurrent(draw->platform->dc, draw->platform->glrc);
@@ -234,16 +235,16 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
134 }
135 }
136 if(ret == 0) {
- -
138 gf_draw_frame(draw);
- +
137 gf_draw_driver_before(draw);
+
138 gf_draw_frame(draw);
+
139 gf_draw_driver_after(draw);
140
141 SwapBuffers(draw->platform->dc);
142 }
143 return ret;
144}
145
- +
146gf_draw_platform_t* gf_draw_platform_create(gf_engine_t* engine, gf_draw_t* draw) {
147 WNDCLASSEX wc;
148 PIXELFORMATDESCRIPTOR desc;
149#ifdef DO_SWAP_INTERVAL
@@ -259,7 +260,7 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
159 platform->instance = (HINSTANCE)GetModuleHandle(NULL);
160 if(platform->instance == NULL) {
161 gf_log_function(engine, "Failed to get instance", "");
-
162 gf_draw_platform_destroy(platform);
+
162 gf_draw_platform_destroy(platform);
163 return NULL;
164 }
165
@@ -277,14 +278,14 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
177 wc.hIconSm = LoadIcon(platform->instance, "GAME");
178 if(!RegisterClassEx(&wc)) {
179 gf_log_function(engine, "Failed to register class", "");
-
180 gf_draw_platform_destroy(platform);
+
180 gf_draw_platform_destroy(platform);
181 return NULL;
182 }
183
184 platform->window = CreateWindow("goldfish", draw->title, (WS_OVERLAPPEDWINDOW), draw->x, draw->y, draw->width, draw->height, NULL, 0, platform->instance, NULL);
185 if(platform->window == NULL) {
186 gf_log_function(engine, "Failed to create window", "");
-
187 gf_draw_platform_destroy(platform);
+
187 gf_draw_platform_destroy(platform);
188 return NULL;
189 }
190
@@ -307,7 +308,7 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
207 platform->glrc = wglCreateContext(platform->dc);
208 if(platform->glrc == NULL) {
209 gf_log_function(engine, "Failed to create OpenGL context", "");
-
210 gf_draw_platform_destroy(platform);
+
210 gf_draw_platform_destroy(platform);
211 return NULL;
212 }
213 wglMakeCurrent(platform->dc, platform->glrc);
@@ -331,7 +332,7 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
231 return platform;
232}
233
- +
234void gf_draw_platform_destroy(gf_draw_platform_t* platform) {
235 if(platform->glrc != NULL) {
236 wglMakeCurrent(NULL, NULL);
237 }
@@ -348,18 +349,8 @@ $(document).ready(function(){initNavTree('opengl_2wgl_2gf__draw_8c_source.html',
248 free(platform);
249}
Drawing interface.
-
void gf_draw_frame(gf_draw_t *draw)
Draw frame (common part)
-
void gf_draw_reshape(gf_draw_t *draw)
Do stuffs required on resizing window.
Drawing driver.
-
void gf_draw_driver_before(gf_draw_t *draw)
Called before gf_draw_frame.
Definition gf_driver.c:61
-
void gf_draw_driver_after(gf_draw_t *draw)
Called after gf_draw_frame.
Definition gf_driver.c:71
Platform-dependent part of drawing driver.
-
void gf_draw_platform_destroy(gf_draw_platform_t *platform)
Destroy platform-dependent part of drawing driver.
Definition gf_draw.c:179
-
int gf_draw_platform_has_extension(gf_draw_t *draw, const char *query)
Check if renderer has extension.
Definition gf_draw.c:99
-
void gf_draw_platform_begin(void)
Initialize platform-dependent part of drawing driver.
Definition gf_draw.c:23
-
void gf_draw_platform_end(void)
Cleanup platform-dependent part of drawing driver.
Definition gf_draw.c:24
-
gf_draw_platform_t * gf_draw_platform_create(gf_engine_t *engine, gf_draw_t *draw)
Create platform-dependent part of drawing driver.
Definition gf_draw.c:123
-
int gf_draw_platform_step(gf_draw_t *draw)
Do platform-dependent step.
Definition gf_draw.c:101
Logger.
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition gf_log.h:26
diff --git a/engine/physics_8h.html b/engine/physics_8h.html index 40cb831..d0b3dcc 100644 --- a/engine/physics_8h.html +++ b/engine/physics_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/physics_8h_source.html b/engine/physics_8h_source.html index 5de9ab5..1a9d23a 100644 --- a/engine/physics_8h_source.html +++ b/engine/physics_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/posix_2gf__thread_8c_source.html b/engine/posix_2gf__thread_8c_source.html index 0e846d9..3f1a97c 100644 --- a/engine/posix_2gf__thread_8c_source.html +++ b/engine/posix_2gf__thread_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -120,7 +121,7 @@ $(document).ready(function(){initNavTree('posix_2gf__thread_8c_source.html','');
20}
21
-
22gf_thread_t* gf_thread_create(void (*func)(void*), void* userdata) {
+
22gf_thread_t* gf_thread_create(void (*func)(void*), void* userdata) {
23 gf_thread_t* thread = malloc(sizeof(*thread));
24 thread->context.func = func;
25 thread->context.data = userdata;
@@ -131,18 +132,15 @@ $(document).ready(function(){initNavTree('posix_2gf__thread_8c_source.html','');
30
- +
31void gf_thread_join(gf_thread_t* thread) {
32 void* value;
33 pthread_join(thread->thread, &value);
34}
35
-
36void gf_thread_destroy(gf_thread_t* thread) { free(thread); }
+
36void gf_thread_destroy(gf_thread_t* thread) { free(thread); }
Required headers before anything.
Thread interface.
-
void gf_thread_join(gf_thread_t *thread)
Join thread.
Definition gf_thread.c:31
-
gf_thread_t * gf_thread_create(void(*func)(void *), void *userdata)
Create thread.
Definition gf_thread.c:22
-
void gf_thread_destroy(gf_thread_t *thread)
Destroy thread.
Definition gf_thread.c:36
Thread context.
Definition thread.h:42
void * data
Data to be passed to thread.
Definition thread.h:42
void(* func)(void *)
Function to be called for thread.
Definition thread.h:42
diff --git a/engine/server_8h.html b/engine/server_8h.html index 88afcd1..3b8acd0 100644 --- a/engine/server_8h.html +++ b/engine/server_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/server_8h_source.html b/engine/server_8h_source.html index 3820c96..0d26ce9 100644 --- a/engine/server_8h_source.html +++ b/engine/server_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__audio__decoder__t.html b/engine/structgf__audio__decoder__t.html index bf283b0..72b91f7 100644 --- a/engine/structgf__audio__decoder__t.html +++ b/engine/structgf__audio__decoder__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__audio__t.html b/engine/structgf__audio__t.html index bffdcb8..13c0ad4 100644 --- a/engine/structgf__audio__t.html +++ b/engine/structgf__audio__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__client__t.html b/engine/structgf__client__t.html index 77efa4f..7f84dad 100644 --- a/engine/structgf__client__t.html +++ b/engine/structgf__client__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__draw__driver__t.html b/engine/structgf__draw__driver__t.html index 542514c..670e1b9 100644 --- a/engine/structgf__draw__driver__t.html +++ b/engine/structgf__draw__driver__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__draw__driver__texture__t.html b/engine/structgf__draw__driver__texture__t.html index f57b158..b79aede 100644 --- a/engine/structgf__draw__driver__texture__t.html +++ b/engine/structgf__draw__driver__texture__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__draw__platform__t.html b/engine/structgf__draw__platform__t.html index 26b679c..4744e76 100644 --- a/engine/structgf__draw__platform__t.html +++ b/engine/structgf__draw__platform__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__draw__t.html b/engine/structgf__draw__t.html index 9515ab8..bc6c8c7 100644 --- a/engine/structgf__draw__t.html +++ b/engine/structgf__draw__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__engine__t.html b/engine/structgf__engine__t.html index 1b0534f..b8daad8 100644 --- a/engine/structgf__engine__t.html +++ b/engine/structgf__engine__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__font__bbox__t.html b/engine/structgf__font__bbox__t.html index 5eddccb..383304f 100644 --- a/engine/structgf__font__bbox__t.html +++ b/engine/structgf__font__bbox__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__font__glyph__t.html b/engine/structgf__font__glyph__t.html index 88e24a8..5694416 100644 --- a/engine/structgf__font__glyph__t.html +++ b/engine/structgf__font__glyph__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__font__store__t.html b/engine/structgf__font__store__t.html index e7d2086..2c43fe7 100644 --- a/engine/structgf__font__store__t.html +++ b/engine/structgf__font__store__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__font__t.html b/engine/structgf__font__t.html index ac4bf95..a64415d 100644 --- a/engine/structgf__font__t.html +++ b/engine/structgf__font__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__graphic__color__t.html b/engine/structgf__graphic__color__t.html index 9566ef3..1393d20 100644 --- a/engine/structgf__graphic__color__t.html +++ b/engine/structgf__graphic__color__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__gui__button__t.html b/engine/structgf__gui__button__t.html index c7fcf33..d7a20f9 100644 --- a/engine/structgf__gui__button__t.html +++ b/engine/structgf__gui__button__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__gui__component__t.html b/engine/structgf__gui__component__t.html index c1e181e..8b8126c 100644 --- a/engine/structgf__gui__component__t.html +++ b/engine/structgf__gui__component__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__gui__t.html b/engine/structgf__gui__t.html index 5bc4cc9..ddf8c71 100644 --- a/engine/structgf__gui__t.html +++ b/engine/structgf__gui__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__input__t.html b/engine/structgf__input__t.html index cbbc188..a3da4d9 100644 --- a/engine/structgf__input__t.html +++ b/engine/structgf__input__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__mesh__t.html b/engine/structgf__mesh__t.html index 9c210ab..c1c8a03 100644 --- a/engine/structgf__mesh__t.html +++ b/engine/structgf__mesh__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__mesh__triangle__t.html b/engine/structgf__mesh__triangle__t.html index 9298c07..bc9f765 100644 --- a/engine/structgf__mesh__triangle__t.html +++ b/engine/structgf__mesh__triangle__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__model__t.html b/engine/structgf__model__t.html index fa8b7f9..79c82fc 100644 --- a/engine/structgf__model__t.html +++ b/engine/structgf__model__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__physics__t.html b/engine/structgf__physics__t.html index 8119ee1..53ee864 100644 --- a/engine/structgf__physics__t.html +++ b/engine/structgf__physics__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__server__t.html b/engine/structgf__server__t.html index a055ef3..75261d9 100644 --- a/engine/structgf__server__t.html +++ b/engine/structgf__server__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__texture__t.html b/engine/structgf__texture__t.html index 55479e6..1600ad6 100644 --- a/engine/structgf__texture__t.html +++ b/engine/structgf__texture__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__thread__context__t.html b/engine/structgf__thread__context__t.html index e15bbed..8d5f182 100644 --- a/engine/structgf__thread__context__t.html +++ b/engine/structgf__thread__context__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__thread__t.html b/engine/structgf__thread__t.html index fc2aa17..4720438 100644 --- a/engine/structgf__thread__t.html +++ b/engine/structgf__thread__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/structgf__version__t.html b/engine/structgf__version__t.html index 94c43f7..8bbb5f6 100644 --- a/engine/structgf__version__t.html +++ b/engine/structgf__version__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/texture_8h.html b/engine/texture_8h.html index 4204ff5..5f32338 100644 --- a/engine/texture_8h.html +++ b/engine/texture_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/texture_8h_source.html b/engine/texture_8h_source.html index 9e14658..ca8d37c 100644 --- a/engine/texture_8h_source.html +++ b/engine/texture_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/thread_8h.html b/engine/thread_8h.html index 16de0db..d216f46 100644 --- a/engine/thread_8h.html +++ b/engine/thread_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/thread_8h_source.html b/engine/thread_8h_source.html index 0e5ad65..a0486ab 100644 --- a/engine/thread_8h_source.html +++ b/engine/thread_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/uniongf__gui__union__t.html b/engine/uniongf__gui__union__t.html index 9696fa8..4b5507d 100644 --- a/engine/uniongf__gui__union__t.html +++ b/engine/uniongf__gui__union__t.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/version_8h.html b/engine/version_8h.html index 2ba80b3..5669991 100644 --- a/engine/version_8h.html +++ b/engine/version_8h.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/version_8h_source.html b/engine/version_8h_source.html index dfdaaed..0f8bfc3 100644 --- a/engine/version_8h_source.html +++ b/engine/version_8h_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
diff --git a/engine/win32_2gf__thread_8c_source.html b/engine/win32_2gf__thread_8c_source.html index 2940daf..0f31f05 100644 --- a/engine/win32_2gf__thread_8c_source.html +++ b/engine/win32_2gf__thread_8c_source.html @@ -24,6 +24,7 @@ +
GoldFish Engine
@@ -119,7 +120,7 @@ $(document).ready(function(){initNavTree('win32_2gf__thread_8c_source.html','');
19 return 0;
20}
21
-
22gf_thread_t* gf_thread_create(void (*func)(void*), void* userdata) {
+
22gf_thread_t* gf_thread_create(void (*func)(void*), void* userdata) {
23 gf_thread_t* thread = malloc(sizeof(*thread));
24 thread->context.func = func;
25 thread->context.data = userdata;
@@ -128,17 +129,14 @@ $(document).ready(function(){initNavTree('win32_2gf__thread_8c_source.html','');
28 return NULL;
29}
30
-
31void gf_thread_join(gf_thread_t* thread) { WaitForSingleObject(thread->thread, INFINITE); }
+
31void gf_thread_join(gf_thread_t* thread) { WaitForSingleObject(thread->thread, INFINITE); }
32
-
33void gf_thread_destroy(gf_thread_t* thread) {
+
33void gf_thread_destroy(gf_thread_t* thread) {
34 CloseHandle(thread->thread);
35 free(thread);
36}
Required headers before anything.
Thread interface.
-
void gf_thread_join(gf_thread_t *thread)
Join thread.
Definition gf_thread.c:31
-
gf_thread_t * gf_thread_create(void(*func)(void *), void *userdata)
Create thread.
Definition gf_thread.c:22
-
void gf_thread_destroy(gf_thread_t *thread)
Destroy thread.
Definition gf_thread.c:36
Thread context.
Definition thread.h:42
void * data
Data to be passed to thread.
Definition thread.h:42
void(* func)(void *)
Function to be called for thread.
Definition thread.h:42