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

Pages: [1]
1
Graphics / Re: Weird errors with sf::Shader
« on: May 18, 2015, 10:54:31 pm »
Visual Studio has a special "debugging version" of std::string that contains extra information which it uses in debug builds. You are probably mixing a debug application and release library or vice versa. Make sure the configurations match up and your application will pass the string verbatim to SFML.

Thanks so much, this did the trick.

2
Graphics / Weird errors with sf::Shader
« on: May 16, 2015, 06:26:06 pm »
I've decided to try out sf::shader, however when I make even the simplest of shader programs I get errors I can't make sense of. I'm not new to GLSL, I've used it in unity.

My code is the example code from the "getting started with 2d drawing" tutorial with little modification.
the code I've added (besides initializing a simple sf:RectangleShape) is the following:

Code: [Select]
const std::string fragmentShader = "void main(){}";
shader.loadFromMemory(fragmentShader, sf::Shader::Fragment);

The expected result is a fragment shader that does nothing (I had more, but tried eliminating lines to find the root issue)

I get an unexpected error message upon running the program,
Code: [Select]
Failed to complile fragment shader:
Fragment shader failed to compile with the following errors:
ERROR: 0:1 error(#132) Syntax error: "<" parse error
ERROR: error(#273) 1 compilation errors. No code  generated

Note that there is no '<' in the code, also sometimes when I run the program it has a similar error but with a '!' indicated as the syntax error.

Also, (I don't know if this could be related) when I tried loading a shader from a file it filled the console with junk text before crashing)

the full code is the attachment.
I'm using VS2013

Pages: [1]