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

Pages: 1 ... 4 5 [6]
76
SFML projects / Re: d3d (Deferred 3D) - A 3D Engine Using SFML
« on: April 14, 2014, 05:03:36 am »
Those pictures look amazing!

77
SFML projects / Re: 'Tiled' Tile-map Loader
« on: April 13, 2014, 08:21:32 pm »
Oh, I knew it was something small. Thanks. This looks really neat.

Is there a preferred way to make the Tiled images? Do you just make them with a paint program like GIMP or MS Paint?

78
SFML projects / Re: 'Tiled' Tile-map Loader
« on: April 13, 2014, 03:53:54 am »
This project looks really cool, but I'm having some difficulties building the example programs (in this case, Benchmark.cpp). I've looked at all the posts in this thread and I think I'm having an issue with the zlib library and Visual Studio 2012 ( I'm a VS newbie ). I have a feeling I'm making a common mistake and hopefully somebody might be able to catch it  8).

So, I have a VS project set up for TMX and SFML, it looks like the screenshot in my attachments. I think I have the TMX files linked correctly with Visual Studio. I know how to get SFML working, so I can check that off. I downloaded the zlib library from zlib.net ( the one with the DLL ) because I saw somebody post that earlier in the thread. It's called " zlib128-dll " and has a .dll file within called " zlib1.dll ". I put the zlib1.dll file in the debug folder in my project like I do with SFML .dll's for dynamic linking.

In Project Properties->Configuration->C/C++->General I have this:
Code: [Select]
C:\Program Files (x86)\SFML-2.1\include;C:\sfml-tmxloader-master\sfml-tmxloader-master\include;C:\zlib128-dll\include;
Then in Project Properties->Configuration->Linker->General
Code: [Select]
C:\Program Files (x86)\SFML-2.1\lib;C:\zlib128-dll\lib;
Lastly, in Project Properties->Configuration->Linked->Input->Additional Dependencies
Code: [Select]
sfml-system-d.lib;sfml-graphics-d.lib;sfml-main-d.lib;sfml-window-d.lib;
I trimmed the last line a bit because the rest of the  library files are probably irrelevant for this ( like kernel32.lib ). Any suggestions?

79
Window / Re: Resizing Window, but contens don't update
« on: December 25, 2013, 08:43:47 am »
That makes sense. I'll try it out. So I could create my checkerboard Squares with an area of 125 square pixels, but if I wanted to resize the window down to something like 800 x 600, the window should automatically take care of resizing the contents? Or should I call the scale function on the squares and scale them up / down by any ratio that works for me? I guess I just want to double check about what you mean for a fixed size. I think what I've been doing for test cases, is to assume to x or y offset are about 125 pixels, since I usually use a 1000 x 1000 size window, and the checkerboard is 8 x 8 which cuts the squares down into a nice 125. I think I see what I need to do, I need to always keep the offset @ 125, and then the window will adjust?

Thanks!

80
Window / Resizing Window, but contens don't update
« on: December 25, 2013, 07:37:56 am »
Hello, I just started using SFML not too long ago and I decided to try to make a checker game project. I'm also new to C++ as well (figured I should mention that as a disclaimer...).

This post is about an issue I have with resizing the window and the checkerboard not updating. The attatched screenshot ("Window_Resize_Test_1.png") shows how the checkerboard doesn't scale with the size of the window, but the checkerpieces do! In my code, I use a main game loop that does the event handling and a window.clear(), "draw stuff", and then window.display() cycle like in the tutorials. The checkerboard in the screenshot is made using the Shape class.

void Checkerboard :: drawGrid(sf::RenderWindow& window, int mouseOverX, int mouseOverY)
{
        int xOffset = 0, yOffset = 0;

        for(int i = 0; i < SQUARES_VERTICAL; ++i)
        {      
                for(int j = 0; j < SQUARES_HORIZONTAL; ++j)
                {
                        if((j % 2 == 0 && i % 2 == 0) || (j % 2 != 0 && i % 2 != 0)) // find the white squares
                                squareArray[i][j]->setFillColor(sf::Color::White);
                        else
                                squareArray[i][j]->setFillColor(sf::Color::Black);

                        squareArray[i][j]->setPosition(xOffset, yOffset); // set the position for drawing
                        squareArray[i][j]->setSize(sf::Vector2f(window.getSize().x / SQUARES_HORIZONTAL, window.getSize().y / SQUARES_VERTICAL));
                        window.draw(*squareArray[i][j]);

                        xOffset += window.getSize().x / SQUARES_HORIZONTAL;
                }

                yOffset += window.getSize().y / SQUARES_VERTICAL;
                xOffset = 0;
        }
}

It was my hope that passing the window reference in the draw cycle of the main game loop would keep the checkerboard size updated. What really confuses me is that the checkerpieces scale perfectly with the window, so I think I'm just overlooking something altogether (I can post the checkerpiece draw function but its functionally the same as drawGrid). I Googled the issue and saw this guy had a similiar issue http://chrisheydrick.com/2013/06/04/problems-re-sizing-sfml-renderwindow/. Needless to say I tried it and it didn't work out. Lastly, I should mention that I can initialize the window to any reasonable size when the RenderWindow object is constructed in the main function and the checkerboard looks fine. The issue is only when I resize the window.

Pages: 1 ... 4 5 [6]