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
25
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) {
26
/* TODO: Implement this */
27
return
NULL;
28
}
29
30
void
gf_draw_driver_destroy_texture(
gf_draw_driver_texture_t
* t) {
31
/* TODO: Implement this */
32
free(t);
33
}
34
35
gf_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
45
int
gf_draw_driver_has_extension(
gf_draw_t
* draw,
const
char
* query) {
return
0; }
46
47
void
gf_draw_driver_reshape(
gf_draw_t
* draw) {
/* TODO: Implement this */
}
48
49
void
gf_draw_driver_begin_texture_2d(
gf_draw_t
* draw,
gf_texture_t
* texture) {
/* TODO: Implement this */
}
50
51
void
gf_draw_driver_end_texture_2d(
gf_draw_t
* draw) {
/* TODO: Implement this */
}
52
53
void
gf_draw_driver_set_color(
gf_draw_t
* draw,
gf_graphic_color_t
color) {
/* TODO: Implement this */
}
54
55
void
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
61
void
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
71
void
gf_draw_driver_after(
gf_draw_t
* draw) {}
gf_directx.h
DirectX headers.
gf_draw.h
Drawing interface.
gf_draw_driver.h
Drawing driver.
gf_draw_platform.h
Platform-dependent part of drawing driver.
gf_graphic.h
Graphic interface.
gf_log.h
Logger.
gf_log_function
#define gf_log_function(engine, fmt,...)
Output log with line number and function name.
Definition
gf_log.h:26
gf_math.h
Math.
gf_pre.h
Required headers before anything.
gf_texture.h
Texture.
gf_draw_driver_t
Drawing driver.
Definition
draw_driver.h:50
gf_draw_driver_texture_t
Driver-dependent texture.
Definition
draw_driver.h:58
gf_draw_t
Drawing interface.
Definition
draw.h:108
gf_engine_t
Engine instance.
Definition
core.h:46
gf_graphic_color_t
Color.
Definition
graphic.h:44
gf_texture_t
Texture.
Definition
texture.h:49
graphic
directx
gf_driver.c
Generated by
1.9.8