Hello folks,
this is my first topic in this forum. First of all my english is not very good.
Iam actually playing with the C-SFML Libary. Iam coding in C. Iam dont rly know C++, so thats why.
Former i used the SDL Libary, which was easy. C-SFML seems also to be very easy.
Actually i try to put some Example Shader(Edge Detection from the Examples), to a picture. Just for testing in my own gui. But i just failing first for the blend mode...
I use the latest codeblocks and csfml version, with mingw32.
bool MenuPlaceIMG(int x, int y, bool type, int id)
{
// Initialisieren
if(!CSFMLIsInit || !mstate.isInit)
return false;
sfSprite *sprite = sfSprite_create();
sfShader *shader = sfShader_createFromFile(NULL, NULL, "edge.frag");
sfRenderStates state;
if(shader == NULL || sprite == NULL)
{
printf("Shader oder Sprite kann nicht geladen werden!");
return false;
}
sfVector2f position = {x, y};
sfSprite_setPosition(sprite, position);
sfShader_setFloatUniform(shader, "edge_threshold", 1.0f);
// Bild zeichnen
if(type == false)
{
sfSprite_setTexture(sprite, media.header, sfTrue);
sfTexture_setSmooth(media.header, sfTrue);
sfShader_setTextureUniform(shader, "texture", media.header);
state.blendMode = sfBlendAdd;
state.shader = shader;
state.texture = media.header;
state.transform = sfTransform_Identity;
}
else
{
sfSprite_setTexture(sprite, media.bg[id].background, sfTrue);
sfTexture_setSmooth(media.bg[id].background, sfTrue);
sfShader_setTextureUniform(shader, "texture", media.bg[id].background);
state.blendMode = sfBlendAdd;
state.shader = shader;
state.texture = media.bg[id].background;
state.transform = sfTransform_Identity;
}
sfRenderWindow_drawSprite(screen, sprite, &state);
// Speicher freigeben
sfShader_destroy(shader);
shader = NULL;
sfSprite_destroy(sprite);
sprite = NULL;
return true;
}
If i tryn compile this, i got some linker errors, and iam actually sure, that i linked all libarys...
My errors:
|249|undefined reference to `_imp__sfBlendAdd'|
|252|undefined reference to `_imp__sfTransform_Identity'|
|260|undefined reference to `_imp__sfBlendAdd'|
|263|undefined reference to `_imp__sfTransform_Identity'|
||error: ld returned 1 exit status|
By The way, when i want to use the default Colors like sfBlack or something, i get the same errors.
My Link-Libarys sequence are the following
Audio
Network
Graphics
Window
System
Anyone an idea to fix this?
Thank you all in advance for help or tips.
Greetings MOP