Sega Saturn Development > General Jo Engine Help
Why doesnt this work...
(1/1)
b1tsh1ft3r:
This seems fairly straight forward and SHOULD work. Is there something i am missing here? The idea was to have a global integer variable
that could change what was drawn in the draw_screen function.
vars.h
--- Code: ---
#ifndef __VARS_H__
#define __VARS_H__
typedef struct
{
int test;
} _vars;
extern _vars vars;
#endif
--- End code ---
main.c
--- Code: ---
#include <jo/jo.h>
#include "vars.h"
void draw_screen(void)
{
jo_clear_screen();
if(vars.test == 1)
{
jo_printf_with_color(15, 5, JO_COLOR_INDEX_White, "test 1");
}
if(vars.test == 2)
{
jo_printf_with_color(15, 5, JO_COLOR_INDEX_White, "test 2");
}
}
void initialize(void)
{
jo_core_init(JO_COLOR_Black);
jo_core_add_callback(draw_screen);
jo_core_run();
}
void jo_main(void)
{
initialize();
vars.test = 2;
}
--- End code ---
b1tsh1ft3r:
Nvermind, figure out jo_core_run() is a blocking function
Navigation
[0] Message Index
Go to full version