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 2 3 [4] 5 6 ... 13
46
Python / pysfml2-cython
« on: February 28, 2012, 04:13:12 am »
I have added a Windows installer for Python 2.7 32-bit. Feedback is welcome.
I have removed the source snapshot with Cython-generated files, as it was mainly intended to make the compilation easier for Windows users.

For version numbers, I think I'm just going to increase the revision number every time I generate a new installer. When SFML is released, I will use the same major and minor numbers as SFML, and I will use the revision number for pySFML-related changes. So if you're using SFML 2.1, you'll need pySFML 2.1.x.

47
Python / pysfml2-cython
« on: February 22, 2012, 06:19:29 pm »
Quote from: "dfanz0r"
Ok, for now i can just use the prebuilt version all im using now is clock window and event. I will need the Audio streaming stuff later on though. Will soon be looking into keyboard and joysticks too. Network would be useful at some point down the road but its not really needed for a while.


Keyboard and joysticks should work fine. Network classes aren't ported because their features are available in the Python standard library. I'll add streaming as soon as possible.

Quote from: "dfanz0r"
I found something that would probably be good to fix

http://www.sfml-dev.org/documentation/2.0/classsf_1_1Clock.php

In the documentation for SFML 2 it says Clock.restart() should return the time since the clock was started.

Can you make this return that time also? It should be a pretty quick fix.


Thanks, I made the change as soon as I read your message.

Quote from: "gtoast"
Figured it out.

Though its not really detailed on the either the SFML2 or the PySFML2 install page, you need to make sure you uncheck the box saying build frameworks when you generate your unix make files in cmake for SFML2.

After that things work fine.


It looks like it's mentioned here: http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

Quote
CMAKE_INSTALL_FRAMEWORK_PREFIX (Mac OS X only)
This is the install path for frameworks. By default, it is defined to the root library, i.e. /Library/Frameworks folder. As stated for CMAKE_INSTALL_PREFIX it is not mandatory to install files after compiling, but it is cleaner to install them.
This path is used to install on your system sndfile.framework (a required dependency not provided by Apple) and SFML as frameworks if BUILD_FRAMEWORKS is selected.


Quote from: "dfanz0r"
Ok so i have built it in MinGW this time it builds, and i think it runs fine.

The newer version doesn't seem to want to play nicely with another cython module im using for speeding up openGL some. The older build worked fine with it. Any idea's?


I've tried to use this module for OpenGL calls myself, so I need to know which tools you're using.
I now have a working Visual Studio installation, hopefully I'll be able to make it easier to build the module with it.

Quote from: "Razzeeyy"
Excuse me, but do this binding works with python3?
I'm just confused by the 'cython' word.
AFAIK Cython is just different interpreter for python, isn't it? or it provides a bit different syntax too?


Cython is a tool used to create CPython 2/3 extension modules. I have modified the documentation to be more clear about that.

48
General discussions / New graphics API ready
« on: February 04, 2012, 01:06:17 am »
The only way I figured it out was to read SFML's shapes' source. Update()'s documentation says that you must call it when the geometry changes, and it's not obvious that this includes when you haven't set the geometry yet.
I think it should be in the introduction as well, currently it's easy to believe that you only need to override the two methods.

In my Python binding, RenderTarget.draw() takes a list instead of a Vertex* a vertex count, so I'm considering removing VertexArray. But I'm wondering, why not use let the user pass a vector<Vertex> in C++ then?

49
General discussions / New graphics API ready
« on: February 02, 2012, 10:58:02 pm »
Is it normal that when inheriting from Shape, I need to call Update() to see anything? (If I don't, the virtual methods never get called.)
From the doc, it's not obvious that you need to call it for a static shape.

50
Python / pysfml2-cython
« on: February 02, 2012, 01:10:27 am »
I haven't updated most examples yet, so the last error is normal.
It's difficult for me to guess where the errors exactly come from, as I'm not used to build DLLs on Windows. I know that the Cython developers almost don't use Windows, so this could be a bug in Cython as well.

The thing is, the functions that cause problems shouldn't end up in the DLL in the first place. As far as I know, Cython doesn't allow to make symbols available across compilation units without exporting them in the DLL. At worst, it should be pretty easy to edit sf.cpp manually to remove DL_IMPORT from those functions declarations (but keep the argument of DL_IMPORT(), it should be the return type).

For what it's worth, I didn't have these problems with MinGW when I last built the binding for Windows, and I was already using the same hacks. I was getting crashes at the end of the program with MinGW, however, but I believe the former binding already had that problem.

Currently, I'm focusing on porting all the C++ features (I still need to make Shape inheritance work and port the streaming features), and updating the documentation. I'll try to build the binding on Windows as soon as possible.

51
Python / pysfml2-cython
« on: February 02, 2012, 12:52:55 am »
I fixed a syntax mistake that I did with the last change, but I don't know if that was the problem.

52
Python / pysfml2-cython
« on: February 01, 2012, 10:07:07 pm »
Can you paste it again? I don't know if the two previous changes didn't do anything or if only replace_error_handler() causes problems now.

53
Python / pysfml2-cython
« on: February 01, 2012, 09:47:36 pm »
I have added the changes in the repo. See if it builds now.

54
Python / pysfml2-cython
« on: February 01, 2012, 08:46:21 pm »
So it gets declared this way:

Code: [Select]
__PYX_EXTERN_C DL_IMPORT(struct __pyx_obj_2sf_RenderStates) *wrap_render_states_instance(sf::RenderStates *);

It looks like you just need to add DL_IMPORT in hacks.hpp's prototypes.

55
Python / pysfml2-cython
« on: February 01, 2012, 12:45:01 am »
Ah, I see. These two functions are declared as extern in the Cython, and they clash with either their own declaration in sf.cpp, or with those in hack.hpp (but that seems odd).
The problem is that Cython doesn't seem to have any mechanism to make a function not static, but not exported in the DLL either. So I'm just using “extern” and hope that it won't cause too much trouble. On GNU/Linux, I tried to override the linkage with linker args or scripts, with no success.

Could you look for the declaration/definition of wrap_render_states() in sf.cpp and copy them here? Or just copy the whole file.

56
Python / pysfml2-cython
« on: January 31, 2012, 05:32:39 pm »
Are you using the snapshot in the downloads? Sorry, it wasn't up to date. I updated a new one, but currently I'm focusing more on making a “stable” release along with SFML 2. I still need to do some changes in the source, then I'll update the documentation.

57
Python / pysfml2-cython
« on: January 31, 2012, 04:58:59 am »
By the way, one important change is that I removed Drawable. To create your own drawable, you now just need to add the draw() method in your class (see the C++ documentation for now).

58
Python / pysfml2-cython
« on: January 27, 2012, 02:03:12 am »
I have updated the binding for the latest version. The main change is the new graphics API. Some stuff still needs to be done, see TODO.txt. The documentation and the examples haven't been updated yet.

I had to rewrite a lot of things, so some parts may be broken. Please report any problem you encounter.

59
General discussions / New graphics API ready
« on: January 25, 2012, 05:45:54 pm »
Thanks.

60
General discussions / New graphics API ready
« on: January 25, 2012, 04:33:54 pm »
Shader's doc says:

Quote
To apply a shader to a drawable, you must pass it as an additional parameter to the Draw function:

Code: [Select]
window.Draw(sprite, shader);

... which is in fact just a shortcut for this:

Code: [Select]
sf::RenderStates states;
states.Shader = shader;
window.Draw(sprite, states);



But I can't find a Draw(drawable, shader) method in RenderWindow or RenderTarget. Am I missing something?

Pages: 1 2 3 [4] 5 6 ... 13