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

Pages: [1]
1
Graphics / Render to a sub rectangle?
« on: February 06, 2009, 11:33:40 pm »
Quote from: "Laurent"
Quote
I saw that in the header files for 1.4

Really? What did you see?


Actually, I think I only saw the forward declaration in Image.hpp.

2
Graphics / Is There A Function To Draw A Single Pixel ??
« on: February 06, 2009, 10:11:44 pm »
Here's what I did, I made an sf::Image the size of the renderwindow. Then I used setpixel() to set the appropriate pixels white/black when needed.

3
Graphics / Render to a sub rectangle?
« on: February 06, 2009, 10:08:55 pm »
Awesome, I saw that in the header files for 1.4, but couldn't actually instantiate one, so I figured it was under construction.

Edit: How is this going to perform, compared to rendering to a renderwindow?

4
Graphics / Render to a sub rectangle?
« on: February 06, 2009, 06:14:08 pm »
I'm building a top down, real time space game. I'd like to have a minimap available, and I'm somewhat stuck on how to do this.

I currently have a graphics manager, who maintains a list of graphics tokens (a wrapped sprite, basically). I also have an sf::View set up to properly show everything at the right scale. Because we needed to conform to box2d's standards, we scale all our images way down, then zoom the camera in.

My draw method currently iterates over my graphcis tokens and draws them, and everything is wonderful. Now, however, I'd like to redraw everything in that list, only to a 100x100 area in the corner of the screen.

Now, let's say my View shows 80x60 world units, and I want my minimap to show 500x500 world units. Now, my brain tells me that this is what sf::View was born to do. Seems like my graphics manager should be able to maintain a 'game view' and a 'map view' and just swap them out.

Only, there seems to be no way to render to anything but the framebuffer. I'd like to render everything to an image, for example, then draw that image in the upper right hand corner. Or tell my view to only draw on a sub section of the renderwindow. Is there a way to do this?

5
Graphics / Does SFML batch render draw calls?
« on: February 03, 2009, 11:31:13 pm »
For now, the workaround I've found is simply to have my background class contain 1 sf::Image that I change the pixels of. Every Update() I write all the star pixels black, change all my structs, and write their new locations white.

It's resulted in a 10x improvement in framerate, and it allows me to draw many more stars.

6
Graphics / Does SFML batch render draw calls?
« on: February 03, 2009, 11:12:04 pm »
So, I have a corollary to this. I'm building an asteroids-esque game, and I want to have stars flying by in the background with parallax, hue, etc.

Currently, I just a 1x1px png for my star, and an array of sprites to accomplish what I want. So my Background.Draw() method looks something like:

Code: [Select]

for (int i = 0; i < MAX_STARS; i++)
{
  renderWindow.Draw(_stars[i]);
}


I've looked at my code using two different profilers, and this is where I am spending the majority of each frame. Setting MAX_STARS above 100 or so really impacts the framerate. Is there a better way to do this?

Eventually, batching will solve this problem, right?

7
Graphics / Software Emulation for PostFX?
« on: October 20, 2007, 09:32:27 pm »
Intel 965/963 Graphics Media Accelerator

Unfortunately, I do not support those extensions.

My desktop machine does though. So I suppose I can just move my SFML program back and forth as needed.

Edit: I looked into NVEmulate, but couldn't get it to do anything.

8
Graphics / Software Emulation for PostFX?
« on: October 19, 2007, 10:27:39 pm »
Is there a way to emulate the pixel shading in sofware? I'd like to test some effects on my laptop, which has onboard graphics.

9
General / Strange characters in Title bar
« on: September 16, 2007, 08:25:08 pm »
Quote from: "Mindiell"
If you are compiling in debug mode, you have t ouse the -d libraries.
When you link the libraries you have to do it in the good order :
-lsfml-graphics-d
-lsfml-window-d
-lsfml-system-d


Yes, this is true. This works fine if I am trying to do a console application. Although it does generate 19 linker warnings.

I don't want that console window to pop up, so I made a win32 application. The tutorials say that I can include sfml-main.lib and just use int main() as an application starting point. Is there a better way to accomplish this?

10
General / Strange characters in Title bar
« on: September 16, 2007, 07:47:55 pm »
Sorry, I'm using Visual Studio 2005.

I'm compiling in debug mode, but with the regular libraries.

If I change the libraries to their -d equivalents I get over 200 linker errors.
My only thought is that I somehow installed it wrong?

Here's what I did:
Copied the items in the vc2005/lib/static folder to my VC/lib folder.
Copied the SFML folder to my VC/Include folder.

Then I added the pieces I wanted to my linker:
sfml-graphics.lib sfml-main.lib sfml-windows.lib sfml-system.lib

Then I had to exlude the following from my linker:
msvcrtd.lib

That is ALL I did, are there any other steps? Am I missing something here?

EDIT:
If I try and build a release version using the libraries, I get this error:
Code: [Select]

fatal error C1047: The object or library file 'G:\Development\Microsoft Visual Studio 8\VC\lib\sfml-graphics.lib' was created with an older compiler than other objects; rebuild old objects and libraries

11
General / Strange characters in Title bar
« on: September 16, 2007, 01:20:17 am »
I'm using the code from the graphics tutorial. I keep getting these strange characters in my title bar.

ÌÌÌÌSFML Test


This is a win32 application (not console.) I've linked sfml-graphics.lib, sfml-main.lib, sfml-window.lib, and sfml-system.lib in that order.

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>

////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{

    // Create the main rendering window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Test",sf::Window::Fixed);

    // Change background color to red
    App.SetBackgroundColor(sf::Color(0, 0, 0));

    // Start game loop
    bool Running = true;
    while (Running)
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Close)
                Running = false;

            // A key has been pressed
            if (Event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (Event.Key.Code == sf::Key::Escape)
                    Running = false;

                // F1 key : capture a screenshot
                if (Event.Key.Code == sf::Key::F1)
{
sf::Image Screen = App.Capture();
Screen.SaveToFile("screenshot.jpg");
}
            }
        }

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

    return EXIT_SUCCESS;
}

Pages: [1]