Hi,
this works fine:
#include <SFML/Graphics.h>
#define SCREENWIDTH 1000
#define SCREENHEIGHT 1000
#define BITSPERPIXEL 32
sfRenderWindow* sf_init()
{
sfVideoMode mode =
{ SCREENWIDTH, SCREENHEIGHT, BITSPERPIXEL };
/* Create the main window */
return sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, NULL);
}
void main(){
sfRenderWindow* window = sf_init();
}
But why doesn't work this:
#include <SFML/Graphics.h>
#define SCREENWIDTH 1000
#define SCREENHEIGHT 1000
#define BITSPERPIXEL 32
void sf_init(sfRenderWindow *window)
{
sfVideoMode mode =
{ SCREENWIDTH, SCREENHEIGHT, BITSPERPIXEL };
/* Create the main window */
window = sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, NULL);
}
void main(){
sfRenderWindow* window;
sf_init(window);
}
Any ideas into where the problem lies? Thanks.