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

Pages: [1] 2
1
General / Crash when attempting to initialize anything SFML Mingw
« on: June 17, 2013, 03:25:05 pm »
I've been working on getting a client going with SFML network but I am having a lot of difficulty.

I am compiling with Mingw 32 bits on Ubuntu, using the most recent SFML 2 stable release. I am trying to compile a Windows executable with i686-w64-mingw32-g++.
Here is the code:
http://pastebin.com/RUbRE41D
The crash occurs on line 41, or whenever I initialize an SFML object.
Here is my procedure:
i686-w64-mingw32-g++ -c message.cpp
i686-w64-mingw32-g++ -o messager.exe message.o -lsfml-network -lsfml-graphics -lsfml-window -lsfml-system


It compiles and links without error, but when I execute the .exe with wine, this is my output:
http://pastebin.com/100r5tTN

I've never dealt with "Unhandled Page Fault on Write Access" errors, so what should I do? I have all of the DLLs in the same directory etc. and have tried reinstalling SFML. Also, compiling SFML for Windows in Linux myself is not preferred!

2
Graphics / Origin after sub rect
« on: April 11, 2013, 02:53:48 pm »
If you sub-rect a sprite, is the origin relative to the image without the sub rect or just the sub rect image? (both 1.6 and 2.0)

EDIT: I tested on 2.0 and it is relative to the sub rect (thank heavens), what about 1.6?

3
Window / Input Layer
« on: April 10, 2013, 05:36:51 pm »
I have a library that provides a layer over SFML so I can swap it out for other versions/libraries (right now I have an SFML 1.6 version and an SFML 2.0 version). The only thing that I have to change when I swap from the SFML 1.6 layer to the SFML 2.0 layer (and vice versa) is sf::Key to sf::Keyboard (and vice versa).

What I want to do is make my own layer over those enumeration values so that I have a call like this:
myApp::isPressed(myApp::code::K)
rather than
myApp::isPressed(sf::Key::K)
that works on the SFML 1.6 and 2.0 layers without breaking them (so it becomes sf::Key::K or sf::Keyboard::K in SFML 1.6 or SFML 2.0 respectively).

Are there any functions that would make this easier? Or do I need to make my own key codes, then have a converter function that converts it from one to the other with a switch or something?

4
Graphics / Drawing lines in SFML 2.0
« on: December 14, 2012, 01:25:20 am »
How do I draw lines in SFML 2.0? It seems like sf::Shape::Line was removed, so do I just
sf::ConvexShape line;
line.setPointCount(2);
line.setPoint(0, startPoint);
line.setPoint(1, endPoint);
line.setOutlineThickness(5);
win.draw(line);
 

? Is there a better way?

5
Window / Prevent Clicking Offscreen
« on: October 24, 2012, 02:23:36 am »
How do I make it so the user cannot click off the screen? I have an action TDS and the play testers became frustrated when the window was buried after they clicked off screen while aiming.

6
General discussions / Raspberry Pi Support?
« on: July 27, 2012, 12:15:18 am »
I've just ordered a Raspberry Pi (not sure when it will come, but I don't think I'll be waiting too long), and was wondering how well SFML works with the Pi. Does the library need to be edited internally in order to support OpenGL ES? Has anyone started working on something like that?

7
General / Help with splitting my project into multiple files
« on: July 23, 2012, 05:50:11 pm »
I'm splitting my large main.cpp into multiple files for better organization right now.  What I was wondering was where I put the SFML include headers. Here's what my project looks like so far:

main.cpp //This is the file that contains all my code
graphics2D.h //These are the files that my code will be distributed into
graphics2D.cpp
soundAndMusic.h
soundAndMusic.cpp
networking.h
networking.cpp

Do I #include <SFML/component.hpp> in the component header and .cpp files, or just the header files? Do I need to include SFML in main.cpp, even if I'm only calling functions in the seperate modules?

8
Graphics / Setting Subrects or separating a spritesheet
« on: May 26, 2012, 11:34:08 pm »
Hi, I have a quick question.  I have a tile map system which takes a tile sheet and a map file in order to display tlle-based maps. Should I split the tile sheet into separate images of each tile or just use Subrects?

9
Graphics / Tilemap Clipping
« on: December 08, 2011, 04:23:41 am »
Hi, I just finished coding a simple tile map outputting system and was pondering over the problem of clipping the sprites at the top and left edges of the window.  I was planning on having smooth(ish) scrolling where the tiles move over as little as 1 pixel even though they are 64X64 or 32X32.  I am aware that if the origin is negative the image isn't displayed.  What would the best way be to handle the clipping of the tiles?  Would sf::View work well?
EDIT: Actually, I guess images ARE still displayed even if the origin is negative.  I guess I don't really need to worry about the clipping anymore :)

10
Window / Windows thinks my window is closing due to an error
« on: December 03, 2011, 04:47:05 am »
Hi!  In my code, for some reason when I purposely close the window, Windows gives me the "...encountered a problem and needs to close" error message following the closing of the window.  When I check if the window is opened and the check returns false, I just say break or return 1, but Windows thinks I errored up for some reason:
Code: [Select]

//Note that this is in my game loop
//This closes the window automatically if it detects the event (it works)
gm.checkToClose();
        //This uses sf::RenderWindow::IsOpened for the check
        if (gm.checkOpened()==false)
        {
            std::cout << "Window isn't opened, returning 1";
            return 1; //This does exit the program, but the command line
                          //used for debugging stays opened until Windows error
                          //shuts it down
        }

This will give me an error.  Note that I have isolated SFML, hence the other functions instead of the SFML functions.

11
Graphics / Tilemap at 7 fps
« on: November 30, 2011, 03:09:59 pm »
Hi.  I just finished making a simple tilemap outputter.  For some reason, it runs at 7 FPS without even drawing that much (just 40 16X16 images subrected from one 416X416 image).  The structure of my tilemap class is that it reads from a file two characters, a-z, then translates those to numbers and stores them in an array.  The displayTileMap() function then goes through the array and subrects the image according to the numbers in the array.  That image is then displayed and it loops again on the next numbers.  Once the end character is reached in the array the function is finished.  I execute the displayTileMap() function every frame.  I just tryed it with only 26 images to be drawn and it still gets only 13 fps.  What should I do to get more performance?

12
General / PSP Homebrew with SFML?
« on: August 31, 2011, 12:50:02 am »
Would it be possible to port SFML to a Playstation Portable for homebrew?
SDL has done it, so SFML should also make a port.  It is out of my knowledge doing this stuff, so it would be sweet if someone else could do it.  Sorry if this is a dumb question, but I don't really know the details of porting.  Anyways, it would be beast to make SFML games on the PSP.

13
General / Input class cannot copy App.GetInput()
« on: August 22, 2011, 07:22:12 pm »
Hi, I'm having trouble programming my own input class.  Here is the basic code I'm having problems with:
Code: [Select]

class input
{
    sf::RenderWindow *iApp;
    sf::Input Input;


    input(sf::RenderWindow *window)
    {
        iApp=window;
    }
//////THIS FUNCTION MUST BE CALLED EVERY FRAME TO GET NEW //INPUTS
    void refreshInput()
    {
        Input=iApp->GetInput();
    }
    ////////////////////////////////////////////////////////////////
    bool checkKey(sf::Key::Code code)
    {
        return Input.IsKeyDown(code);
    }
    void checkMouse(unsigned int *x, unsigned int *y)
    {
        *x=Input.GetMouseX();
        *y=Input.GetMouseY();
    }
    bool checkMouseKey(sf::Mouse::Button button)
    {
        return Input.IsMouseButtonDown(button);
    }

};


My compiler  (code::blocks gcc) outputs this error:

..\..\..\..\..\..\..\..\SFML-1.6\include\SFML\System\NonCopyable.hpp||In member function `sf::Input& sf::Input::operator=(const sf::Input&)':|
..\..\..\..\..\..\..\..\SFML-1.6\include\SFML\System\NonCopyable.hpp|64|error: `sf::NonCopyable& sf::NonCopyable::operator=(const sf::NonCopyable&)' is private|

C:\Documents and Settings\My Documents\Development\Programming\C++\My Projects\Game Lib Testing\main.cpp|18|error: within this context|
||=== Build finished: 2 errors, 0 warnings ===|

Thanks for the help...

14
General / My library on SFML?
« on: July 09, 2011, 03:32:50 am »
Hi, I'm making a library that makes it super-simple to use SFML (I know, it's simple already), and I was wondering how I make the .a (lib) file have SFML.  I am using code::blocks and the project is a static link library.  I made some simple test functions and classes in namespace "goo."  How do I set up SFML for the library, and how do I use SFML within the library?
EDIT: After some experimentation, I can access the sf namespace in my library. For the users to run SFML and my library, do all they need to do is put the .DLLs of SFML in their program directory?

15
General / Loading Images with Strings
« on: July 06, 2011, 07:15:42 pm »
Hi! I'm making a library that makes SFML really simple, and I need a way to load images with a string.  The user of the lib creates a new "object," then an object function loads an image and assigns it to an SFML sprite.  The image's filename is passed to the function via a string.  I get a compiler error that the string has to be a constant.  Is there a way around this, or do I need to code it completely differently?

Pages: [1] 2