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

Pages: [1]
1
Graphics / Blurred fonts in newest SFML2
« on: May 28, 2011, 06:24:41 pm »
Hello. I just updated ~5-month old SFML2 to the lastest revision in my project.

Unfortunately, something changed in sf::Text appearance.
Just look at the screen:


(verdana, size: 12)

Is there any way to restore the previous rendering? Everything is blurry now :(

2
Graphics / [SFML2] RenderImage and Text problems
« on: April 27, 2010, 07:50:33 pm »
Hello. I'm trying to draw some strings into sf::RenderImage . Unfortunately, it doesn't work.

Code: [Select]
#include <SFML/Graphics.hpp>


int main()
{
 // First of all: make sure that rendering to image is supported
 if (!sf::RenderImage::IsAvailable())
    return -1;

 // Create a new render-window
 sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

 // Create a new render-image
 sf::RenderImage image;
 if (!image.Create(500, 500))
     return -1;

 // The main loop
 while (window.IsOpened())
 {
    // Event processing
    // ...

    // Clear the whole image with red color
    image.Clear(sf::Color::Red);



    // Draw stuff to the image

    sf::Text text("String test", sf::Font::GetDefaultFont(), 12);


    //image.Draw(sprite);  // sprite is a sf::Sprite
    //image.Draw(shape);   // shape is a sf::Shape
    image.Draw(text);    // text is a sf::Text


    // We're done drawing to the image
    image.Display();

    // Now we start rendering to the window, clear it first
    window.Clear();

    // Draw the image
    sf::Sprite sprite(image.GetImage());
    window.Draw(sprite);
    // Uncomment this line to draw text directly
    // window.Draw(text);

    // End the current frame and display its contents on screen
    window.Display();
 }

return 0;
}


The text doesn't appear. When I'm drawing it directy into sf::RenderWindow, it does.

In my more complex app I've got even more weird results:


...but it was when I forgot to call RenderImage::Display(). Now the result is the same.

So... Is it a bug or my mistake?

Thanks for any help :)

3
Graphics / Drawing huge amount of sprites
« on: September 27, 2009, 07:10:26 pm »
Hello. I'm trying to find enough efficient way for drawing map in my game. I want to draw 10000 (100x100) small tiles (32x32px for now). Drawing it in every frame with loop is much faster in SFML 2, but it's still to slow. I'm getting only 60fps (without vsync) on modern computer (on my old laptop it's completely unplayable). So, is there any better way to do this? I was thinking about drawing only actually visible elements, but I'm going to implement zooming (sometimes all sprites will be drawn).
It would be nice to draw all sprites in one call like OpenGL lists, but I don't know how to implement this in SFML...

4
Graphics / Resizing sprite in SFML2
« on: September 25, 2009, 08:58:48 pm »
Hello, I had migrated to the newest wersion of SFML and noticed a weird thing with positioning resized sprites.

The resized sprite looks to be moved at some pixels, what gives me unexpected results:
http://img143.imageshack.us/img143/573/wrong.png

In the previous SFML version (1.5) I've got the correct effect:
http://img143.imageshack.us/img143/5971/correct.png

Is there a bug in the new version of SFML? Or maybe i don't know about some changes in api? :)

Thanks for help.

5
Network / Problem with receiving sf::Packet
« on: September 01, 2009, 05:35:07 pm »
Hello, I found a problem with the sf::SocketTCP::Receive(sf::Packet) function. When I send data, that is not sf::Packet, and try to recieve it with above mentioned function, the code freeze until the client disconnected.

My English is poor, so I'm not sure if anyone will understand my post. :oops: So, I'll try to explain how to reproduce the problem with simple steps:

1. Download and compile example from selectors tutorial:
http://www.sfml-dev.org/tutorials/1.5/network-selector.php

2. Start the program as server

3. (In windows) run "telnet.exe 127.0.0.1 2435"

4. Press any key

The server is no longer responding, until I close the telnet window.

It's a really easy way to "hack" the server. Using a Receive (char *Data, std::size_t MaxSize, std::size_t &SizeReceived) function works, but I'm getting only raw data, not a sf::Packet.

6
Network / sf::Packet and single char
« on: August 31, 2009, 08:00:07 pm »
Hi

Is it possible, to send and receive single char via sf::packet? I'm trying to do this with simple code:

Code: [Select]

sf::Packet packet;
char test = 0x01;
packet << test;
//sending packet



Code: [Select]

sf::Packet packet;
//receiving packet
char test;
packet >> test;
if (test == 0x01) std::cout << "Correct";
else std::cout << "Wrong" << (int)test;


...but it's not work: test is alyways 0.

Is there any solution for this problem?
Thanks

Pages: [1]