1
General / Re: Can you integrate allegro into an sfml window?
« on: May 19, 2024, 11:57:24 am »
When you add the files to your project, make sure you're only compiling VideoTexture.cpp (not the header files)
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.
I'm not against the idea, I just have no clue how I'd approach it.
I'm aware that may be due to my lack of understanding of OpenGL, so if that's the case please let me know. Thank you
uniform sampler2DArray u_texture;
uniform float u_frameIndex;
in vec2 v_texCoord;
out vec4 o_colour;
void main()
{
o_colour = texture(u_texture, vec3(v_texCoord, u_frameIndex));
}
//vertex shader
in vec2 a_position;
in vec2 a_texCoord;
in float a_frameIndex;
out vec2 v_texCoord;
flat out float v_frameIndex;
void main()
{
gl_Position = //usual stuff here
v_texCoord = a_texCoord;
v_frameIndex = a_frameIndex;
}
//then in the fragment shader we do as before, only the frame index comes from the vertex shader, not a uniform:
uniform sampler2DArray u_texture;
in vec2 v_texCoord;
flat in float u_frameIndex;
out vec4 o_colour;
void main()
{
o_colour = texture(u_texture, vec3(v_texCoord, u_frameIndex));
}
sf::String str(u8"🌙");
sf::String str(0x2600);
str += sf::String(0xFE0F);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
myArray.draw();
myOtherArray.draw();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
char_creation_name_input_txt.setString(sf::String::fromUtf8(name_input_string.begin(), name_input_string.end());