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

Pages: [1]
1
Network / _debugger_hook_dummy = 0
« on: June 16, 2010, 10:52:55 pm »
Hey guys,

I'm having a problem, when its time for the "Ftp::Response serverResp = Server.Download("wr5pruf6","main",Ftp::Binary );" comand to be executed, the file is downloaded but i get a fatal error and points me to: _debugger_hook_dummy = 0
Any ideas on how to resolve?

2
Graphics / Event::Closed problem
« on: April 23, 2010, 01:06:25 am »
Hey,

In my project I have 3 Main screens: Menu, The game itself and ScoreBoard.
Now the problem is that when i run the Scoreboard function which draws the ScoreBoard, I noticed that the condition 'Event.Type == Event::Closed' is executed while I didn't close the Window. But with the Menu it doesn't happen.
Any sugestions?

Code: [Select]

bool Menu(sf::RenderWindow &Window);
bool ScoreBoard(sf::RenderWindow &Window);

if (ScoreBoard(Window))
return 0;
if (Menu(Window))
return 0;

//both Menu and ScoreBoard Event loop
while (Window.GetEvent(Event));
{
gui.ProcessKeys(&Event); //only ScoreBoard has this line
if (Event.Type == Event::Closed)
return true;
}

3
Graphics / Image is drawn transparent after vector resize?
« on: February 27, 2010, 02:09:35 am »
Hey there,
in my game, when i blast a balloon (with an object inside of it) the object begins to drop, and the balloon that had been blasted gets a new random position (without another object). Now that i wanted to do add a new object when balloon is poped, i resized my vector <Object> and initialize it with Image, positions, etc. Now when i pop a any balloon, all objects seem not to have any image with them :roll: they appear transparent. But if i dont add that resize of the vector the game works fine (without the new object when balloon pop).
Code: [Select]
balloon[i].SetIsAlive(false);
object[i].Drop = true;
object[i].BalloonIndex = i;
GenBalloons(i, balloon);
works fine
Code: [Select]
balloon[i].SetIsAlive(false);
object[i].Drop = true;
object[i].BalloonIndex = i;
GenBalloons(i, balloon);
//-----------------
object.resize(object.size() + 1);
if (!object[object.size() - 1].Image.LoadFromFile("main\\object1.png"))
return 1;
object[object.size() - 1].Sprite.SetImage(object[object.size() - 1].Image);
object[object.size() - 1].Sprite.SetCenter(object[object.size() - 1].Sprite.GetSize().x / 2, object[object.size() - 1].Sprite.GetSize().y / 2);
object[object.size() - 1].Sprite.SetPosition((balloon[i].Sprite.GetPosition().x - object[object.size() - 1].Sprite.GetPosition().x) / 2, (balloon[i].Sprite.GetPosition().y - object[object.size() - 1].Sprite.GetPosition().y) / 2);
object[object.size() - 1].Drop = false;
object[object.size() - 1].SetIsAlive(true);
object[object.size() - 1].BalloonIndex = i;
object[object.size() - 1].SetSpeed(object[i].GetSpeed());

doesnt work fine

Window.Draw()
Code: [Select]
for (int i=0;i<BALLOONINDEX;i++)
{
//if (object[i].Drop == true  && ObjectColHand(i, object, hand) == false)
Window.Draw(object[i].Sprite);
}

4
Window / The key pressed delay
« on: January 30, 2010, 10:55:26 pm »
Hi,

Im doing a sprite to move to the left, and using:
Code: [Select]
if (evento.Type == evento.KeyPressed &&
evento.Key.Code == Key::A)
sMao.SetPosition(sMao.GetPosition().x - (1000*Window.GetFrameTime()),sMao.GetPosition().y);


but, when i press the A button still it does the same as im writing a text: the 1st A goes there but then a delay, after that delay it goes sending the A all over (if always pressed). Is there a solution for that?
Thanks

5
Graphics / Random Window freeze
« on: January 12, 2010, 08:36:23 pm »
Hey,
I do have this problem several times, but just after testing with the minimum code to run the SFML that I confirm this. I don't know why happens but, when I compile the project and the window pops up some times it freezes and if it is freezed I can't click anywhere because it doesn't work, only if I 'ALT+TAB' to choose other window. It also happens when the app runs great and then after a few moments (random time) freezes again. Its abit anoying, because before I test my game I need to test if the window isn't frozen, if it is I need to try to run again and again until the window runs correctly (if doesn't freeze again lol).
If you need any info just say.
Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
   
    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

linker: "sfml-system-s-d.lib sfml-window-s-d.lib sfml-graphics-s-d.lib"
Win XP SP3, VS 2008

6
General / Mouse click in circle
« on: January 12, 2010, 12:20:15 am »
Hey,
I'm trying to click inside a image that has a circle in it (its centered) with the mouse so i tried doing a circle using the sf::Shape and checking if the X,Y of the mouse is inside the X,Y of the circle but ofcourse it doesnt work (silly idea). How can I know if the Mouse is been clicked inside the circle?

7
Graphics / std::string crashes
« on: January 06, 2010, 01:29:03 am »
This is more like a C++ problem then SFML, but like i readed in a post that i need to get the Full String before seting it into SetText()...
I marked the line with a arrow.
Code: [Select]

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

using namespace sf;

int main()
{
RenderWindow Window(VideoMode(800, 600), "testing");

//Variaveis
Image Imagem1;
Image Imagem2;
Sprite Sprite;
Font font;
String Text;
std::string texto;

//Condições
if(!Window.IsOpened())
return 1;
if(!Imagem1.LoadFromFile("img\\Hud\\hud.png"))
return 1;
if(!Imagem2.LoadFromFile("img\\Teste\\1.png"))
return 1;
if(!font.LoadFromFile("arial.ttf"))
return 1;

//Atribuições
Text.SetFont(font);
Text.SetSize(50);
Text.SetColor(Color::White);
Text.SetPosition(0,200);
Sprite.SetImage(Imagem1);

//Main loop
while (Window.IsOpened())
{
Event evento;
----->texto = evento.MouseMove.X + "," + evento.MouseMove.Y;

while (Window.GetEvent(evento))
{
if (evento.Type== Event::Closed)
return 0;
if ((evento.Type== Event::MouseButtonPressed ) && (evento.MouseButton.Button == Mouse::Left))
Text.SetText(texto);
}

Window.Clear();
Window.Draw(Sprite);
Window.Draw(Text);
Window.Display();
}
}


Heres the crash: http://i.imagehost.org/0589/sfml1.jpg

8
Graphics / OpenGL and SFML weird thing
« on: December 20, 2009, 11:22:03 pm »
Hey,
my window freezes, and me and my professor can't figure out what it is
Code: [Select]
#include <GL/GLee.h>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

using namespace sf;

int main()
{
RenderWindow Window(sf::VideoMode(800,600,32),"GL SandBox");
//Window.PreserveOpenGLStates(true);
//glMatrixMode(GL_PROJECTION);
//glLoadIdentity();
//glOrtho(0,800,0,600,-1,1);
//glMatrixMode(GL_MODELVIEW);
/*Vector2f Vertices[4] =
{
Vector2f(350,250), //Canto superior esquerdo
Vector2f(450,250), //Canto superior direito
Vector2f(450,350), //Canto inferior direito
Vector2f(350,350) //Canto inferior esquerdo
};*/
while (Window.IsOpened())
{
Window.Clear();
//glEnableClientState(GL_VERTEX_ARRAY);
//glVertexPointer(2,GL_FLOAT,0,Vertices);
//glDrawArrays(GL_QUADS,0,4);
Window.Display();

}


return 0;
}


Please try runing in your pc if it works, i already tried using Window.hpp but no result either... :roll:
btw, Win XP SP3, VS2008 SP1

Pages: [1]