fix dll stuff

This commit is contained in:
NishiOwO 2025-04-13 19:18:21 +09:00
parent e3aebb7d19
commit 46a70634da
No known key found for this signature in database
GPG Key ID: 27EF69B208EB9343
4 changed files with 12 additions and 14 deletions

View File

@ -89,8 +89,6 @@ void gf_draw_driver_init(gf_draw_t* draw) {
glLightfv(GL_LIGHT0, GL_DIFFUSE, lightwht);
glLightfv(GL_LIGHT0, GL_SPECULAR, lightblk);
glLoadIdentity();
for(i = 0; i < sizeof(gf_font) / sizeof(gf_font[0]); i++) {
unsigned char* font = malloc(8 * 8 * 4);
int j;
@ -139,8 +137,8 @@ void gf_draw_driver_begin_texture_2d(gf_draw_t* draw, gf_texture_t* texture) {
}
void gf_draw_driver_end_texture_2d(gf_draw_t* draw) {
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 0);
}
void gf_draw_driver_set_color(gf_draw_t* draw, float r, float g, float b, float a) { glColor4f(r / 255, g / 255, b / 255, a / 255); }
@ -156,16 +154,11 @@ void gf_draw_driver_before(gf_draw_t* draw) {
GLfloat lightpos[3];
GF_VECTOR_COPY(draw->light, lightpos);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gf_draw_driver_reshape(draw);
gluLookAt(draw->camera[0], draw->camera[1], draw->camera[2], draw->lookat[0], draw->lookat[1], draw->lookat[2], 0, 1, 0);
glLightfv(GL_LIGHT0, GL_POSITION, lightpos);
glPushMatrix();
gf_graphic_clear(draw);
}
void gf_draw_driver_after(gf_draw_t* draw) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
void gf_draw_driver_after(gf_draw_t* draw) { glFlush(); }

View File

@ -59,7 +59,7 @@
#define GF_DECLARE_TYPE(n, b) typedef struct _gf_##n b gf_##n##_t;
#if defined(_WIN32) && defined(_DLL)
#if defined(_WIN32) && defined(GF_DLL)
#define GF_EXPORT __declspec(dllexport)
#else
#define GF_EXPORT extern

View File

@ -233,13 +233,14 @@ project("GoldFish")
filter("options:engine=static")
kind("StaticLib")
defines({
"ODE_LIB"
"ODE_LIB",
"GF_LIB"
})
filter("options:engine=dynamic")
kind("SharedLib")
defines({
"ODE_DLL",
"_DLL"
"GF_DLL"
})
filter("configurations:Debug")
defines({

View File

@ -25,10 +25,12 @@ void draw_frame(gf_draw_t* draw) {
int max = 5;
str[1] = 0;
gf_graphic_fill_rect(draw, 200, 200, 200, 200, 0, 0, 255, 255);
for(y = 0; y < draw->height; y += s) {
for(x = 0; x < draw->width; x += s / 2) {
str[0] = d[(i++) % strlen(d)];
gf_graphic_text(draw, x, y, s, str, 255 / max * r, 255 / max * g, 255 / max * b, 255);
gf_graphic_text(draw, x, y, s, str, 255.0f / max * r, 255.0f / max * g, 255.0f / max * b, 255);
b++;
if(b == max + 1) {
@ -44,6 +46,8 @@ void draw_frame(gf_draw_t* draw) {
}
}
}
gf_graphic_fill_rect(draw, 0, 0, 200, 200, 255, 0, 0, 255);
}
int main(int argc, char** argv) {