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

Pages: [1]
1
General / Re: Why isn't the image being displayed?
« on: April 02, 2016, 12:20:05 pm »
Just the error I  put "Error".

2
General / Re: Why isn't the image being displayed?
« on: April 01, 2016, 04:54:37 pm »
I added setTextureRect and a console Error if it failed to load, now it's displaying a white rectangle inside the black rectangle but still no image, and it's showing the console error. I put the image in the project directory directly so I don't have to worry about the '/'s for now too.I tried the full path and I tried using multiple images but the issue doesn't go away.

3
General / Why isn't the image being displayed?
« on: April 01, 2016, 04:36:45 pm »
#include "stdafx.h"
#include <iostream>
#include <SFML/Graphics.hpp>
int main(){
sf::VideoMode videomode(800, 800);
sf::RenderWindow window(videomode, "game");
sf::Sprite sprite;
sf::Texture texture;
texture.loadFromFile("Images\catz.png");
sprite.setTexture(texture);
sprite.setPosition(200, 200);
while (window.isOpen()){
    window.clear();
    window.draw(sprite);
    window.display();
    sf::Event event;
    while (window.pollEvent(event)){
        if ((event.type == sf::Event::Closed))
            window.close();
        }

    }
}


Image is in:-
 Documents\Visual Studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\Images

The working directory is the project directory.
Why isn't this working? I've tried Images '//' and '\\' and '/' and '\' but none is working, the program displays a black window instead,could anyone please help?

Pages: [1]