This is a very quick question, I am learning OpenGL all thought that is irrelevant to the question it will just be very obvious in my code.
The issue I am having is that my assert macro will doesn’t seem to detect the right value.
here is the code in question,
<code>#define ASSERT(x) if (!x) __debugbreak();
#define GLCall(x) GLClearError();
x;
ASSERT(GLLogCall(#x, __FILE__, __LINE__))
</code>
<code>#define ASSERT(x) if (!x) __debugbreak();
#define GLCall(x) GLClearError();
x;
ASSERT(GLLogCall(#x, __FILE__, __LINE__))
</code>
#define ASSERT(x) if (!x) __debugbreak();
#define GLCall(x) GLClearError();
x;
ASSERT(GLLogCall(#x, __FILE__, __LINE__))
Then where its called,
<code>GLCall(int location = glGetUniformLocation(shader, "u_Color"));
ASSERT(location != -1);
GLCall(glUniform4f(location, 0.2f, 0.3f, 0.8f, 1.0f));
</code>
<code>GLCall(int location = glGetUniformLocation(shader, "u_Color"));
ASSERT(location != -1);
GLCall(glUniform4f(location, 0.2f, 0.3f, 0.8f, 1.0f));
</code>
GLCall(int location = glGetUniformLocation(shader, "u_Color"));
ASSERT(location != -1);
GLCall(glUniform4f(location, 0.2f, 0.3f, 0.8f, 1.0f));
When I debug the code it says the location is 0 but when I run it without a break point it asserts the break point. The weird part is that the assert macro works fine in the other macro that I posted. I’m sure its something simple that I’m missing. Anyways any help is appreciated. Thanks.