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

Pages: 1 ... 8 9 [10] 11 12 13
136
Python / Python binding generation tools
« on: April 17, 2011, 01:13:23 am »
Apparently he moved the SFML headers in the PySFML directory. What is strange is that apparently Graphics.hpp was found, but not Window.hpp.

Anyway, you should install the SFML headers (include/*) and libraries (lib/*) in the appropriate directories so that Visual Studio automatically recognizes them.
Apparently, the makefile generated by Cmake has an “install” target, so maybe you can use that, i.e. type “make install” in the console.

137
Python / PySFML for a newbie?
« on: April 15, 2011, 03:55:35 pm »
I haven't tried PySFML for Python 3, but I guess it probably has bugs like 2.x, and they probably won't be fixed, as it isn't under development anymore.
I've written an up to date binding for SFML 2 (which is the version you should probably be using), but sadly I've recently realized that it will need some work before the Python 3 version works.
The Python 2 version is supposed to be somewhat stable, but I'm not getting a lot of feedback from the community. I also think it's very likely that some methods that I never use are buggy, but it should be quickly fixed once someone reports the bug.
Also, I don't really really know where this binding is going. There have been several attempts of writing a better Python binding, but as far as I know, mine is the most complete currently, as well as being as fast as the old binding according to my tests with crappy drivers (I'd need to run them on Windows to get more interesting results). However I didn't get any feedback about that either.

As of learning, currently the best way is to learn with the official C++ tutorials, then learn how it maps to the Python version. I'll try to write a tutorial here one of these days as well.

Pygame is a good alternative, although its API is more awkward and it's slower when you do heavy stuff on hardware-accelerated platforms.

I'd say pick whatever floats your boat. If you need a very stable library or if you need to release a game soon, Pygame is definitively better currently. If you want your game to be usable on all Unix platforms and you know it won't require heavy graphics effects, then I'm not sure everyone will agree with me here, but I think Pygame is more suited as well. (I have terrible performance with SFML on Linux because of Intel's ant ATI's open source drivers.)

Edit: another popular library is Pyglet. It's closer to SFML in that it also uses OpenGL.

138
Python / Python binding generation tools
« on: April 12, 2011, 07:53:35 pm »
With SFML 2's move to Github, I've decided to move the binding to Github as well, although I'm not a huge fan of Git. The new URL is: https://github.com/bastienleonard/pysfml2-cython

I've updated the binding so that it works with the latest SFML 2 snapshot.
I'm also going to start a clean topic one of these days, since this one is supposed to be about the various way to generate Python bindings.

As usual, you can download a snapshot of the source at Github, which won't require that you install Cython.

139
SFML projects / Atom Zombie Smasher
« on: April 06, 2011, 12:37:25 pm »
Reminds me of people who say assembly is as practical as high-level languages because they have such and such macros that make it so easy to create a local variable or call a function.

140
Python / Trouble with pysfml and Windows 7
« on: April 04, 2011, 04:45:19 pm »
It's been a while since I used the current binding, but I think I randomly had this kind of error at the end of the program. In practice it didn't stop the program from working.

What happens if you use proper event handling to close the window, as in the tutorial?

Code: [Select]
# Include the PySFML extension
from PySFML import sf

# Create the main window
window = sf.RenderWindow(sf.VideoMode(800, 600), "PySFML test")

# Create a graphical string to display
text = sf.String("Hello SFML")

# Start the game loop
running = True
while running:
    event = sf.Event()
    while window.GetEvent(event):
        if event.Type == sf.Event.Closed:
            running = False

    # Clear screen, draw the text, and update the window
    window.Clear()
    window.Draw(text)
    window.Display()


Edit: if you want, you can try my new binding for SFML 2: https://bitbucket.org/bastienleonard/pysfml2-cython.
But you'll need to compile it yourself, I can't compile SFML 2 on Windows for some reason.

141
Python / Python binding generation tools
« on: March 25, 2011, 11:02:17 am »
Anyone wants to test it? I uploaded a snapshot that doesn't require Cython to compile: https://bitbucket.org/bastienleonard/pysfml2-cython/downloads

I tried to test it on Windows, but I get a strange error when compiling SFML 2 with VC++ 2008 (I'll probably post that in another topic).

142
Python / Python binding generation tools
« on: March 10, 2011, 07:13:50 am »
I uploaded a source release: https://bitbucket.org/bastienleonard/pysfml2-cython/downloads/PySFML%202-0.0.1.zip

I think the main features are there, but there's probably a lot of bugs lurking around.

The generated documentation is there (unfinished also, of course): http://bastien-leonard.alwaysdata.net/pysfml/doc/index.html (for some reason, index.html has to be in the URL)

143
General / Keep sprite in movement
« on: March 10, 2011, 12:38:49 am »
You can use the Input class to know whether a key is currently pressed. Obtain the Input instance with RenderWindow.GetInput().

144
Python / Python binding generation tools
« on: March 10, 2011, 12:24:04 am »
I tried to make it easy to retrieve the last error message.
This code appears to work:

Code: [Select]
const char* last_message = NULL;
std::size_t last_message_size = 0;

class MyBuff : public std::streambuf
{
    std::streamsize xsputn(const char* s, std::streamsize n)
    {
        last_message = s;
        last_message_size = n;

        return n;
    }
};

MyBuff my_buff;
sf::Err().rdbuf(&my_buff);


I'm worried about not overriding all that is needed, and that the method might be called several times for the same message if it's long.
Aslo, is there a simpler way?

145
Python / PySFML and komodo?
« on: February 23, 2011, 08:05:57 pm »
I don't understand what your goal is.

Visual Studio would only be useful for compiling PySFML, and the current release doesn't need to be compiled, you can download it directly. (However, it's quite outdated and has some bugs, so maybe that's why you're compiling the latest source?)
The error message you got means that Python couldn't find your Visual Studio installation, which would mean that you're indeed trying to compile PySFML.
Personally I would recommend using Visual C++ 2008+ Express for this purpose. It should be doable with MinGW, but I got a lot of errors when I tried using it for my own binding.

I've never used Komodo, but it seems to be an IDE for dynamic languages like Python, not C++. You can probably use Komodo with PySFML, like any other module.

146
Graphics / My fake Text console is pretty slow...
« on: February 21, 2011, 05:46:18 am »
There's a library for this kind of game: http://doryen.eptalys.net/libtcod/

147
Python / Python binding generation tools
« on: February 19, 2011, 10:54:08 am »
It's enough for the developer, but do you expect the end-user to execute the game in a console?

148
Python / Python binding generation tools
« on: February 18, 2011, 08:58:54 am »
I've started working on SFML 2: https://bitbucket.org/bastienleonard/pysfml2-cython
I think most classes are there. I'll probably add Unicode support next, then shaders and audio.
There's a lot of stuff in SFML that I never use, so I'm far from having tested everything.
Some stuff could probably rewritten to be faster, but I wait to get feedback on that as it would generally make the code more complicated or dangerous.

I haven't written any doc yet, I'm waiting until the module is more or less complete.

One problem that I have is that I can't raise any specific exception. For example, if a file can't be loaded, there's no way to know if it's a problem of finding the file or format.
I understand that Laurent doesn't want to use exceptions, but why not use something like errno?

149
Feature requests / Proposal to change identifiers
« on: February 15, 2011, 10:42:32 pm »
Quote from: "Nexus"
Any news about changing GetEvent() to PollEvent()? :)


Why not simply Poll()?

150
General / VS2010 C#/.NET and SFML 2.0
« on: February 13, 2011, 09:15:53 am »
The source is there in bindings/dotnet, but I don't know if has updated for SFML 2.
It's also not configured to be compiled by CMake (maybe CMake doesn't support it?).
I can't really help you since I've never used this binding.

Pages: 1 ... 8 9 [10] 11 12 13
anything