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 - poul250

Pages: [1]
1
Graphics / Re: Problem with loading shader
« on: August 28, 2018, 01:40:34 pm »
Oh, thanks, I solved my problem. I'm using Visual Studio c++, and in Project Settings->Linker->Input->additional dependences in Debug configuration i've used sfml-graphics.lib instead of sfml-graphics-d.lib.

2
Graphics / [SOLVED] Problem with loading shader
« on: August 27, 2018, 09:42:01 pm »
I tried to load the shader using the loadFromMemory function, but the console produces a strange error. Here is my code:
#include <string>
#include <SFML/Graphics.hpp>

using namespace sf;

int main()
{
    RenderWindow window(VideoMode(800, 600), "SFML", Style::Close);

    const std::string shade = "void main(){}";
    Shader shader;
    if (!shader.loadFromMemory(shade, Shader::Fragment)) {
        exit(-1);
    }

    return 0;
}
 
Here is console output:
Failed to compile fragment shader:
0(1) : error C0000: syntax error, unexpected $undefined at token "<undefined>"
 
How can I fix this?

Pages: [1]