Skip to content

Bitmap loading error? #9

Closed
Closed
@Estebanmister

Description

Hello, i was testing a bit your engine, and it seems that im not able to load a bitmap and draw it on the screen, i got this error message:
error
here is my code:
``#define PUNITY_IMPLEMENTATION
#include "punity.h"
Bitmap image;
typedef struct Game_
{
Bitmap font;
}
Game;

static Game *GAME = 0;

int
init()
{
GAME = bank_push_t(CORE->storage, Game, 1);

font_load_resource(&GAME->font, "font.png", 4, 7);
CORE->canvas.font = &GAME->font;
Bitmap* imagee = ℑ
bitmap_load_resource(imagee, "image.png", 0);
return 1;

}

void
step()
{
canvas_clear(1);
Bitmap* imagee = ℑ
Rect oho = rect_make(60, 100, 40, 140);
Rect* oo = &oho;
bitmap_draw(imagee, 60, 10, 0, 0, oo);
if (key_down(KEY_ESCAPE)) {
CORE->running = 0;
}

}

I tried changing Assert(comp == 4) to Assert(comp = 4), this seems to work, but it fills the rest of the screen with the main colour of the image.

i just dont know what's happening
PS: i do have image.png declared in the main.rc

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions