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.


Topics - andariel97

Pages: [1]
1
Graphics / Get texture from sf::Text object
« on: July 06, 2017, 03:49:48 pm »
I need to get a texture from a sf::Text object then mix it with another texture in a GLSL Shader. How can i do that?

2
Window / Multiple windows ,but only one receives input
« on: May 07, 2017, 03:20:40 pm »
I want to create 2 windows w1 and w2 and while w2 is open i want the program to NOT let me move or give any events to w1. Is is possible?

3
Graphics / SFML with OpenGL
« on: December 07, 2016, 06:36:44 pm »
I want to create an app with a GUI in modern opengl. I want to use vertexarrays to render the sfml sprites so the program can run faster. So ill need to use a lot of small textures for drawing my GUI elements(buttons,textboxes etc.). The thing is that my GUI is being updated during runtime so i dont know exactly how many textures i have. I know in modern opengl you have a lot of ways to send textures to the shader. Which one would be the best for my problem? In the begining i wanted to use texture units but on my pc i only have 32 texture units which is not much. How do i do to have hundreds of thousands of little textures?I think have to choose between there options which i found on wikipedia but i dont even know what all of them are.
sampler2D​   GL_TEXTURE_2D
sampler3D​   GL_TEXTURE_3D   
samplerCube​   GL_TEXTURE_CUBE_MAP   
sampler2DRect​   GL_TEXTURE_RECTANGLE   
sampler1DArray​   GL_TEXTURE_1D_ARRAY
sampler2DArray​   GL_TEXTURE_2D_ARRAY
samplerCubeArray​   GL_TEXTURE_CUBE_MAP_ARRAY
samplerBuffer​   GL_TEXTURE_BUFFER   Buffer Texture
sampler2DMS​   GL_TEXTURE_2D_MULTISAMPLE
sampler2DMSArray GL_TEXTURE_2D_MULTISAMPLE_ARRAY

4
Graphics / Using sf::VertexArray to draw quads with multiple textures
« on: November 29, 2016, 12:35:45 pm »
In modern opengl, in order to draw quads fast you create a vertexbuffer and you tell the gpu how your data is organised in those bites. The code looks something like this :
void setupMesh()
{
    glGenVertexArrays(1, &this->VAO);
    glGenBuffers(1, &this->VBO);
    glGenBuffers(1, &this->EBO);
 
    glBindVertexArray(this->VAO);
    glBindBuffer(GL_ARRAY_BUFFER, this->VBO);

    glBufferData(GL_ARRAY_BUFFER, this->vertices.size() * sizeof(Vertex),
                 &this->vertices[0], GL_STATIC_DRAW); 

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, this->EBO);
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, this->indices.size() * sizeof(GLuint),
                 &this->indices[0], GL_STATIC_DRAW);

    // Vertex Positions
    glEnableVertexAttribArray(0);   
    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex),
                         (GLvoid*)0);
    // Vertex Normals
    glEnableVertexAttribArray(1);   
    glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex),
                         (GLvoid*)offsetof(Vertex, Normal));
    // Vertex Texture Coords
    glEnableVertexAttribArray(2);   
    glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
                         (GLvoid*)offsetof(Vertex, TexCoords));

    glBindVertexArray(0);


You also use texture units to tell the gpu where are your textures.
glBindTexture(GL_TEXTURE_2D, this->textures.id);

In sfml you can use sf::VertexArray to draw multiple sprites at once. But how do you tell sfml do draw those quads with diferent textures?

5
Graphics / Render text using vertexarrays.
« on: November 28, 2016, 01:57:55 am »
Is there a way to create a sf::Text variable, set up its properties(font,color,fontsize) and the save this as a texture , so later i can use sf::VertexArrays to draw a sprite that has that texture?

6
General discussions / Creating a interface maker using sfml
« on: November 26, 2016, 05:59:35 am »
Hi. Im currently working on a program that uses sfml to create interfaces for my future projects,kinda like how visual studio lets you create interfaces. Lets say for exemple that my program supports buttons and the ability to split the screen into regions. In order to split the screen i read that i should use sfml views and in order to draw faster i should put all of my sprites into a vertexrray. My question is: Is it possible to combine those 2? (to draw a lot of sprites using vertexarray but to draw them in different views?

Pages: [1]