Sorry for the double post, but I have no idea what's going on with this code:
/* test.c generated by valac, the Vala compiler
* generated from test.vala, do not modify */
#include <glib.h>
#include <glib-object.h>
#include <SFML/Window.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _sfWindow_Destroy0(var) ((var == NULL) ? NULL : (var = (sfWindow_Destroy (var), NULL)))
gint _vala_main (char** args, int args_length1);
static sfContextSettings sfml_window_create_context_settings (guint depth_bits, guint stencil_bits, guint antialiasing_level, guint major_version, guint minor_version) {
sfContextSettings result;
sfContextSettings _tmp0_;
result = (_tmp0_.DepthBits = depth_bits, _tmp0_.StencilBits = stencil_bits, _tmp0_.AntialiasingLevel = antialiasing_level, _tmp0_.MajorVersion = major_version, _tmp0_.MinorVersion = minor_version, _tmp0_);
return result;
}
gint _vala_main (char** args, int args_length1) {
gint result = 0;
sfContextSettings cs;
sfVideoMode _tmp0_;
sfVideoMode vm;
sfWindow* w;
cs = sfml_window_create_context_settings ((guint) 800, (guint) 600, (guint) 32, 2, 0);
vm = (_tmp0_.Width = (guint) 320, _tmp0_.Height = (guint) 240, _tmp0_.BitsPerPixel = (guint) 32, _tmp0_);
if (sfVideoMode_IsValid (vm)) {
fprintf (stdout, "%d\n", (gint) cs.MajorVersion);
}
w = sfWindow_Create (vm, "Hej!", sfDefault, cs);
result = (gint) sfNone;
_sfWindow_Destroy0 (w);
return result;
}
int main (int argc, char ** argv) {
g_type_init ();
return _vala_main (argv, argc);
}
I'm getting these errors:
test.vala.c: In function ‘_vala_main’:
test.vala.c:39: error: incompatible type for argument 4 of ‘sfWindow_Create’
/usr/local/include/SFML/Window/Window.h:75: note: expected ‘const struct sfContextSettings *’ but argument is of type ‘sfContextSettings’
I don't see any sfContextSettings* there.
EDIT: Fixed again. I need to be more careful.