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

Pages: [1] 2
1
General / Release version not drawing graphics...
« on: December 01, 2010, 01:05:03 pm »
I completely deleted my SFML-2.0 build from previous started out completely fresh and I got it working, I don't know what the issue was, maybe I had some old files in there from sometime ago, oh well at least it is working now, what I headache that was... thank you so much for your assistance, Ill have to remember if something isn't working right and it should just rebuild the whole thing and delete the old. Sorry for taking so much of your time with this, it was your idea that put that in my head to delete the whole old build and rebuild a new one.

2
General / Release version not drawing graphics...
« on: December 01, 2010, 12:49:05 pm »
Nope, I have all my SDK's under a specific folder, I have no other SFML lib or include directories on my system next to the SFML-2.0 I have in my SDK folder. I take it you are not getting the same problem as I am? So you are not able to replicate it and help me out here? This has been my first time actually building release mode so maybe I did something wrong? Are there any settings I need to make sure I have checked to get it to work?

3
General / Release version not drawing graphics...
« on: December 01, 2010, 12:13:48 pm »
I created SFML 2.0 using CMakelist than opening the project, and compiling all in debug mode and release mode in VS2010 Pro.

4
General / Release version not drawing graphics...
« on: December 01, 2010, 12:05:20 pm »
Crash happens in this code in Release mode. I am all the correct libs linked in input, and the correct dll's in the folder. It builds fine but crashes at my comment. If you make RenderWindow a pointer as I stated above it will actually not crash out, but nothing will draw in the window either.

Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
sf::RenderWindow Game(sf::VideoMode(1024, 768, 32), "SFML Release Test", sf::Style::Close);
sf::Event Event;
const sf::Input& Input = Game.GetInput();

while(Game.IsOpened())
{
while(Game.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
Game.Close();
}

if(Input.IsKeyDown(sf::Key::Escape))
{
Game.Close();
}

Game.Clear();

Game.Display(); //Crash happens here
}

return EXIT_SUCCESS;
}


EDIT** Also if you comment out Display, Clear(); causes a crash as well, but if you comment both out it runs just fine.

5
General / Release version not drawing graphics...
« on: December 01, 2010, 11:50:37 am »
In my classes I have CRender which has RenderWindow as a pointer. It loads and runs perfectly in debug, but in release it builds, it executes, but nothing is visible execept the window.clear(color). I can exit the game no problem.

So I decided to do some test because I honestly thought it was my Physfs.lib not working correctly in Release mode, so I made a basic render window game and noticed something really odd. RenderWindow no longer worked unless it was a pointer like so,

sf::RenderWindow* Game = new sf::Render(blah blah blah);

the reason because if I did it not being a pointer the program would crash and in debugging mode this was causing it,

Game.Clear(); //this was the fault of the crash

I am actually reverting back to a younger release that isn't in beta still, so I can get this added to my portfolio, I just graduated with my Bachelo's in Game Software Development and I need to build my portfolio up some so I can start applying at the game companies around me. I would like to see this fixed as this pointer issue doesn't happen in debug mode.

6
General / Release version not drawing graphics...
« on: December 01, 2010, 10:51:06 am »
I am trying to build a release version of my game, the dropdown in VS is selected as Release, and I linked the release libs without the -d, I also added the release dll's. It compiles normal, but when I execute the program non of my graphics are drawing anymore, but with debug mode and the libs/dlls it works fine. Anyone know what is the issue here? This literally breaks my prototype for my portfolio if I cannot build a release version. Also I am using 2.0 for this.

7
Graphics / Problem when rendering images
« on: September 03, 2010, 05:57:06 pm »
Quote from: "Mindiell"
Try something like Buffer.SetSmooth(false);


Thanks for the suggestion, this cleaned it up and now it displays the way I have it in my tile sheet.

8
Graphics / Problem when rendering images
« on: September 03, 2010, 10:25:10 am »
I didn't really notice this until I started working on my tilemap system for my game, but all my images I try and render have a weird edge color to them on the top and left side of the images. Also I noticed that when I try and declare SetSubRect(left, top, right, bottom) my tile will only be 31, 31 and if I try and make it 32, 32 like it is in the tilesheet I get a portion of the other tile. Is this something already known, or what is the issue I am having here. I tried using different format images and that doesn't seem to fix the issue. I am starting small like a 3x3 tilemap, and I haven't been able to move up to larger because the issue stays the same. Do I need to create a empty space around all my tiles will that fix the issue? It almost seems like in the tilesheet it is blending the edges of the tiles around it creating a faded color. If the tile is alone a 32x32 image, than that faded border is on the top and left like I stated above.

Here is my code, below, if I set the subrect to be 32, 32, 64, 64 I get partial edge of my other tile, and if I try 33, 33, 65, 65 I also get partial edge of my other tile, seems like they are blending some how. And if I do 33, 33, 64, 64 I get not partial edges but then my tile is 31x31 when I take a screenshot and size it up.

Code: [Select]

int main()
{
sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "SFML CLevel Class Test", sf::Style::Close);
sf::Event Event;
const sf::Input& Input = Game.GetInput();

sf::Image Buffer;
sf::Sprite Sprite;
if(!Buffer.LoadFromFile("MapSheet.png"))
return EXIT_FAILURE;
else
{
Sprite.SetImage(Buffer);
Sprite.SetSubRect(sf::IntRect(33, 33, 64, 64));
Sprite.SetPosition(100, 100);
}

while(Game.IsOpened())
{
while(Game.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
Game.Close();
}

if(Input.IsKeyDown(sf::Key::Escape))
Game.Close();

Game.Clear(sf::Color(100, 149, 236));

Game.Draw(Sprite);

Game.Display();
}

return EXIT_SUCCESS;
}

9
General discussions / Simple chat program losing connection.
« on: July 13, 2010, 07:41:23 am »
My mistake on the second connection in the while loop, but what you stated in the last part is completely obvious it is stopping... I am wanting to know why this is occurring, I also didn't ask for a critique of code just a point in the right direction to why this is happening. If you don't want to do that or don't know why please don't respond, I am here for serious help only.

10
General discussions / Simple chat program losing connection.
« on: July 13, 2010, 06:17:31 am »
I just started working on a simple client/server chat program, right now I can connect using the client, no problem here, I send a message to the server and here is where I get disconnected after that, along side I cannot type a new message in on the client either, why is this happening? What am I missing? I have looked at the tutorial and sample, both those have same issue so I don't know what to do to loop it right, any suggestions would be helpful, thank you.

Client code:
Code: [Select]

#include <SFML/Network.hpp>
#include <iostream>
#include <string>

using namespace std;

//Create the TCP socket
sf::SocketTCP Server;
sf::SocketTCP Client;

//Set the port to listen on
const unsigned short Port = 2435;

int main()
{
//Ask user for IP address of the server to connect to
sf::IPAddress ServerAdd;
do
{
cout << "Enter server IP: ";
cin >> ServerAdd;
cout << endl;
if(!ServerAdd.IsValid())
cout << "Error: " << "Invalid IP address..." << endl;
}while(!ServerAdd.IsValid());

//Connect to the server specified by IP address
if(Client.Connect(Port, ServerAdd) != sf::Socket::Done)
cout << "Error connecting to server: " << ServerAdd << endl;

cout << "Connected to server " << ServerAdd << endl;

while(true) //I know this is bad practice, I will fix later!
{
//Connect to the server specified by IP address
if(Client.Connect(Port, ServerAdd) != sf::Socket::Done)
cout << "Error connecting to server: " << ServerAdd << endl;

//Receive a message from the server
char Message[255];
std::size_t Received;
if(Client.Receive(Message, sizeof(Message), Received) != sf::Socket::Done)
cout << "Error receiving message from server: " << ServerAdd << endl;
else
cout << "User: " << Message << endl;

//Send a message to the server
char Sent[255];
cout << "You: ";
cin >> Sent;
cout << endl;
if(Client.Send(Sent, sizeof(Sent)) != sf::Socket::Done)
cout << "Error sending message to server: " << ServerAdd << endl;
}

return EXIT_SUCCESS;
}


Server code:
Code: [Select]

#include <SFML/Network.hpp>
#include <iostream>
#include <string>

using namespace std;

//Create the TCP socket
sf::SocketTCP Server;

//Set the port to listen on
const unsigned short Port = 2435;

int main()
{
//Open a socket and listen to a specified port
if(!Server.Listen(Port))
cout << "Error listing on Port: " << Port << endl;

cout << "Server is listening to port " << Port << ", waiting for connections..." << endl;

while(true) //I know this is bad practice, I will fix later!
{
//Wait for a connection to be established by a client
sf::IPAddress ClientAdd;
sf::SocketTCP Client;
if(Server.Accept(Client, &ClientAdd) != sf::Socket::Done)
cout << "Error not ready for listening..." << endl;
else
{
cout << "Client connected: " << ClientAdd << endl;
char buffer[] = "Connected to Server";
if(Client.Send(buffer, sizeof(buffer)) != sf::Socket::Done)
cout << "Error sendind message to client: " << ClientAdd << endl;
}

char Buffer[128];
std::size_t Received;
if (Client.Receive(Buffer, sizeof(Buffer), Received) != sf::Socket::Done)
cout << "Error receiving message from client: " << ClientAdd << endl;
else
cout << ClientAdd << ": " << Buffer << endl;
}

return EXIT_SUCCESS;
}

11
General discussions / Anyone tell me why SFML slows down over time?
« on: May 12, 2010, 12:11:34 am »
Thanks for all the help everyone, I wanted to figure this out without a restore of my system, but I have installed so much different software and I have experienced a few malware, but I have since then cleansed my system and ran a registry fix program, but in the end I have had to restore my computer. I have been needing to do it anyways so I guess it is ok.

On the upside here the restore has officially fixed the problem, I was thinking maybe it was because I recently installed VS2010 C++ Express when my main compiler is VS2008 Pro, but not really sure I know sometimes things can be weird like that, so I just eliminated all possibilities and did a complete system restore. I can tell you Nvidia 3D Vision only slows the game up for about 1 minute than it runs perfectly fine afterwords, if I disable it, there is no 1 minute slow up. Thanks again for all your help I knew something was wrong no matter what it was probably a good idea I did a restore anyways.

12
General discussions / Anyone tell me why SFML slows down over time?
« on: May 11, 2010, 12:30:56 pm »
As stated before I ran SFML fine before on my desktop before and I have the same hardware/software, the only thing I changed is my main monitor now is a 120hz Viewsonic for 3D and I enabled 3D Vision, I haven't tried disabling this as I didn't see it being the issue, but I guess you never know. My drivers are updated and I am running a Nvidia card not an ATI. I just noticed this issue about 1 week ago when I had to build a game real fast for a class I was taking, I had to do all my programming on my laptop and couldn't even run the game on my desktop due to being to slow.

13
General discussions / Anyone tell me why SFML slows down over time?
« on: May 10, 2010, 05:00:51 pm »
This really isn't about the FPS being calculated, this is about SFML slowing down on my desktop which is far more powerful than my laptop and my laptop runs that same code smoother and doesn't have a consistent slow down, for instance when I move the sprite around it starts out moving fast and gets to the point where it is moving like a snail and still getting slower.

14
General discussions / Anyone tell me why SFML slows down over time?
« on: May 10, 2010, 02:17:06 pm »
Nothing stops the slow down process at all, it start about 700 fps goes up to about ~1200 then starts counting down fast, until it is less than 100 fps and nothing is being drawn to the game screen and nothing is being loaded up just creating the game window, no event, no keyboard input, nothing. I cannot test clear and display as my fps from fraps wont show up anymore if you dont use either of those, well clear will make the fps unreadable. I am officially stumped on this one.

15
General discussions / Anyone tell me why SFML slows down over time?
« on: May 10, 2010, 01:23:58 pm »
Here is the code I have it is basic and simple same code I can run on my laptop at perfect performance.

Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "SFML");

sf::Event Event;

sf::Image image;
sf::Sprite sprite;

if(!image.LoadFromFile("player.png"))
return 1;
sprite.SetImage(image);

while(Game.IsOpened())
{
while(Game.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
Game.Close();
}

if(Game.GetInput().IsKeyDown(sf::Key::Escape))
Game.Close();

if(Game.GetInput().IsKeyDown(sf::Key::W))
sprite.Move(sf::Vector2f(0, -1));
else if(Game.GetInput().IsKeyDown(sf::Key::S))
sprite.Move(sf::Vector2f(0, 1));
if(Game.GetInput().IsKeyDown(sf::Key::A))
sprite.Move(sf::Vector2f(-1, 0));
else if(Game.GetInput().IsKeyDown(sf::Key::D))
sprite.Move(sf::Vector2f(1, 0));

Game.Clear();

Game.Draw(sprite);

Game.Display();
}

return EXIT_SUCCESS;
}

Pages: [1] 2