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 - Tom Clabault

Pages: [1]
1
Hello

So. I compiled my project using Visual Studio 2017 and within Visual Studio, no problems, the project runs fine, everything is alright.
The thing is that when I'm trying to launch the .exe produced by Visual Studio, the game pops, there's a window but it's white, as is there were no textures and it's not responding, as is the program crashed

I searched on the Internet but didn't found any relevant answer.

Thanks in advance

2
Graphics / VertexArray and transparent texture
« on: March 03, 2019, 02:42:32 pm »
Hi!
I'm in front of a problem that doesn't seem to be that of a challenge but still, I'm stuck with it
I've a Quads vertexArray and I've a .png with transparency in it.
The problem is that when displaying the vertices with the texCoords of the image, it shows black instead of transpanrecy

Here's my .png:


I'm defining the vertices' texCoords as follows:
levelVertex[0].texCoords = CORNER_UP_LEFT_TEXTURE;
levelVertex[1].texCoords = CORNER_UP_RIGHT_TEXTURE;
levelVertex[2].texCoords = CORNER_BOTTOM_RIGHT_TEXTURE;
levelVertex[3].texCoords = CORNER_BOTTOM_LEFT_TEXTURE;
 

When displaying, here's what I get:


I tried to set the four vertices' color to sf::Color::Transparent but with that done, it displays a full black Quad

Any thoughts about that?

3
Graphics / My sprite won't show ( black screen )
« on: February 08, 2019, 07:41:18 pm »
Hi!

So I tried to draw a simple sprite but I can't get it to work. Why ? I don't think I have done any mistakes but it just shows a black screen when running the code. What's the problem ?

Here is my code:

#include "include/SFML/Graphics.hpp"

#pragma region Variables
sf::RenderWindow window(sf::VideoMode(750, 750), "Title");
#pragma endregion Variables





int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
{
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear();

                sf::Texture texture;
                texture.loadFromFile(".\\Resources\\Level\\Textures\\dirt.jpg");
                sf::Sprite sprite;
                sprite.setTexture(texture);
                window.draw(sprite);

                window.display();
        }
}

I'm using Visual Studio under Windows 10 if some you wanted these infos.

Thanks in advance

Pages: [1]
anything