forked from Fierelier/me.fier.engine
Change engine_createTexture to engine_texture_create
This commit is contained in:
parent
4769de1797
commit
2e593b1ab2
@ -17,7 +17,7 @@ A software accelerated (CPU-only) game engine for older computers. It uses a lay
|
|||||||
> struct ENGINE_EVENT engine_event_get()
|
> struct ENGINE_EVENT engine_event_get()
|
||||||
|
|
||||||
>> TEXTURES
|
>> TEXTURES
|
||||||
struct ENGINE_TEXTURE engine_createTexture(int width,int height)
|
> struct ENGINE_TEXTURE * engine_texture_create(int width,int height)
|
||||||
> void engine_texture_color_set(char r,char g,char b,char a)
|
> void engine_texture_color_set(char r,char g,char b,char a)
|
||||||
> void engine_texture_draw_pixel(struct ENGINE_TEXTURE * texture,int x,int y)
|
> void engine_texture_draw_pixel(struct ENGINE_TEXTURE * texture,int x,int y)
|
||||||
> void engine_texture_destroy(struct ENGINE_TEXTURE * texture)
|
> void engine_texture_destroy(struct ENGINE_TEXTURE * texture)
|
||||||
|
@ -20,7 +20,7 @@ int engine_luaf_time_sleep(lua_State *L) {
|
|||||||
int engine_luaf_texture_create(lua_State *L) {
|
int engine_luaf_texture_create(lua_State *L) {
|
||||||
int width = luaL_checkinteger(L,1);
|
int width = luaL_checkinteger(L,1);
|
||||||
int height = luaL_checkinteger(L,2);
|
int height = luaL_checkinteger(L,2);
|
||||||
struct ENGINE_TEXTURE * texture = engine_createTexture(width,height);
|
struct ENGINE_TEXTURE * texture = engine_texture_create(width,height);
|
||||||
lua_pushlightuserdata(L,texture);
|
lua_pushlightuserdata(L,texture);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
struct ENGINE_TEXTURE { int width; int height; void * fe_texture; };
|
struct ENGINE_TEXTURE { int width; int height; void * fe_texture; };
|
||||||
struct ENGINE_GENERIC_TEXTURE { char * pixels; };
|
struct ENGINE_GENERIC_TEXTURE { char * pixels; };
|
||||||
|
|
||||||
struct ENGINE_TEXTURE * engine_createTexture(int width,int height) {
|
struct ENGINE_TEXTURE * engine_texture_create(int width,int height) {
|
||||||
// frontend texture
|
// frontend texture
|
||||||
char * pixels = engine_malloc(NULL,sizeof(char) * width * height * 4);
|
char * pixels = engine_malloc(NULL,sizeof(char) * width * height * 4);
|
||||||
#if (ENGINE_GENERIC_TEXTURE_NOCLEAR == 0)
|
#if (ENGINE_GENERIC_TEXTURE_NOCLEAR == 0)
|
||||||
|
2
test.c
2
test.c
@ -124,7 +124,7 @@ void tick() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
texture = engine_createTexture(8,8);
|
texture = engine_texture_create(8,8);
|
||||||
engine_texture_from_file(texture,"assets/textures/fier.rgba");
|
engine_texture_from_file(texture,"assets/textures/fier.rgba");
|
||||||
|
|
||||||
for (int i = 0; i < argc; ++i) {
|
for (int i = 0; i < argc; ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user