1
C / RenderWindow storage size unknown
« on: November 02, 2013, 12:01:44 am »
with sfFont, sfText, and sfRenderWindow, i want to initialize and create variables like:
but i get "storage size of RenderWindow isn't known" and similar errors. I don't really understand what the problem is, and CSFML's Types.h shows (which doesn't clarify anything for me):
Can anyone explain my problem? Am I forced to initialize pointer types and _create functions while minding the scope? I'd ideally like to initialize the variables in one place then pass the pointers into a function that creates/sets their objects. This might not be possible though.
Thanks!
sfVideoMode videoMode = { WINDOW_WIDTH, WINDOW_HEIGHT, BITS_PER_PIXEL };
sfRenderWindow renderWindow;
sfFont font;
sfText text;
&renderWindow = sfRenderWindow_create(videoMode, p_TITLE, sfDefaultStyle, NULL);
&font = sfFont_createFromFile(FILENAME_FONT);
&text = sfText_create();
sfRenderWindow renderWindow;
sfFont font;
sfText text;
&renderWindow = sfRenderWindow_create(videoMode, p_TITLE, sfDefaultStyle, NULL);
&font = sfFont_createFromFile(FILENAME_FONT);
&text = sfText_create();
but i get "storage size of RenderWindow isn't known" and similar errors. I don't really understand what the problem is, and CSFML's Types.h shows (which doesn't clarify anything for me):
typedef struct sfFont sfFont;
typedef struct sfRenderWindow sfRenderWindow;
typedef struct sfText sfText;
typedef struct sfRenderWindow sfRenderWindow;
typedef struct sfText sfText;
Can anyone explain my problem? Am I forced to initialize pointer types and _create functions while minding the scope? I'd ideally like to initialize the variables in one place then pass the pointers into a function that creates/sets their objects. This might not be possible though.
Thanks!