Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Takoo

Pages: [1]
1
General / Re: How to draw VertexArray ?
« on: December 26, 2017, 02:24:04 pm »
Most examples online are in C++ and not C. The error is clear, you need to pass a pointer to render states to that function.

Hi, thanks for ur reply.
I found the problem but now my program segfault when I set texture to my RenderState (L.42: states->texture = texture;).
Error :
(click to show/hide)
My code :
(click to show/hide)

2
General / How to draw VertexArray ?
« on: December 26, 2017, 12:42:13 am »
Hello,
My goal is to draw a tylemap from int*.
After 2 hours of research i didn't resolve my problem :
[Takoo@localhost my_runner_2017]$ make re
rm -f ./src/main.o
rm -f my_runner
gcc -g3 -Wextra -Wall -Werror -I./include   -c -o src/main.o src/main.c
src/main.c: In function ‘main’:
src/main.c:60:50: error: incompatible type for argument 3 of ‘sfRenderWindow_drawVertexArray’
   sfRenderWindow_drawVertexArray(window, vertex, states);
                                                  ^~~~~~
In file included from /usr/local/include/SFML/Graphics.h:46:0,
                 from src/../include/my.h:11,
                 from src/main.c:8:
/usr/local/include/SFML/Graphics/RenderWindow.h:432:25: note: expected ‘const sfRenderStates * {aka const struct <anonymous> *}’ but argument is of type ‘sfRenderStates {aka struct <anonymous>}
 CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [<builtin>: src/main.o] Error 1
[Takoo@localhost my_runner_2017]$
 

I don't understand why my sfRenderWindow_drawVertexArray (L.60) wait a * sfRenderStates while every examples on web uses sfRenderStates without "*".

Here is my code :
(click to show/hide)

Thank's for ur help !  :(

Pages: [1]
anything