GoldFish Engine
Quite simple and lightweight game engine
Loading...
Searching...
No Matches
gf_driver.c
1#define GF_EXPOSE_DRAW_DRIVER
2#define GF_EXPOSE_DRAW
3#define GF_EXPOSE_TEXTURE
4
5#include <gf_pre.h>
6
7/* External library */
8#include <gf_directx.h>
9
10/* Interface */
11#include <gf_draw_driver.h>
12
13/* Engine */
14#include <gf_draw_platform.h>
15#include <gf_texture.h>
16#include <gf_draw.h>
17#include <gf_log.h>
18#include <gf_math.h>
19#include <gf_graphic.h>
20
21/* Standard */
22#include <stdlib.h>
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) {
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;
39
40 /* TODO: Implement this */
41
42 return draw_driver;
43}
44
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 */ }
48
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 */ }
52
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);
59}
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);
69}
70
71void gf_draw_driver_after(gf_draw_t* draw) {}
DirectX headers.
Drawing interface.
Drawing driver.
Platform-dependent part of drawing driver.
Graphic interface.
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.
Drawing driver.
Definition draw_driver.h:50
Driver-dependent texture.
Definition draw_driver.h:58
Drawing interface.
Definition draw.h:108
Engine instance.
Definition core.h:46
Texture.
Definition texture.h:49