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 ... 3 4 [5] 6 7 ... 13
61
Python / Help with PySFML
« on: January 14, 2012, 07:10:04 pm »
The default copy constructor may also be disabled, so I can only trust the documentation (since I was too lazy to read the source code). :)
Looks like I should add a copy() method, and maybe __copy__() too.

62
Python / Help with PySFML
« on: January 14, 2012, 01:32:52 pm »
Is it possible in C++? As far as I can tell, there's no copy constructor.

63
General discussions / A new logo for SFML
« on: January 12, 2012, 05:26:41 am »
These are my favorites:

Quote from: "Cuban-Pete"
Hmm, not so keen on it, but wasted some time on it, so here it is:



//edit: hehe, makes me think: soccer time! or time for Grolsch Beer  :D


The “circle” a bit bulky in my opinion, it distracts from the text.

Quote from: "PointyStick"
A revision, this time with the correct text.



Really clean, but it needs a nicer font in my opinion.

Quote from: "Brendon"
Here's my attempt at the SFML logo!



Really nice!

64
General discussions / New naming convention
« on: January 10, 2012, 03:24:02 pm »
Quote from: "Laurent"
The arguments in favor of the get/is prefixes make sense -- except that I'll never write getBegin()/getEnd() in a container ;)


Have you read this article? http://www.idinews.com/quasiClass.pdf

65
Python / PySFML 2?
« on: January 08, 2012, 01:10:32 am »
Are you sure that the git checkout ... command applies where you build the module? It looks like you're still using the latest SFML 2 version.

Edit: Laurent said that he's going to change the naming conventions on Monday, so I'm going to wait for that before updating the binding.

66
Python / PySFML 2?
« on: January 06, 2012, 11:12:27 pm »
Don't use “python”, on Arch Linux it invokes Python 3. Try “python2 setup.py build_ext --inplace”. It should drop the sf.so module file in the current directory.

67
Python / PySFML 2?
« on: January 06, 2012, 09:42:22 am »
The Git message is normal AFAIK.
If you want to set USE_CYTHON = False, you need to create sf.cpp yourself:

Code: [Select]
cython --cplus sf.pyx

68
Python / PySFML 2?
« on: January 06, 2012, 01:39:13 am »
Can you check that USE_CYTHON is True in setup.py?
I think you will need to type to that to use the oldest compatible SFML version:

Code: [Select]
git checkout 191730ac0d639cfdef8fae560cdbc7d7e8c67db1

69
Python / PySFML 2?
« on: January 05, 2012, 11:24:32 pm »
Cython is just a tool that I used to make this binding. It works on Python 2 and Python 3. I write the binding in the Cython language, the cython tool translates it to C++, then it can be compiled like any other Python extension module.

70
Python / PySFML 2?
« on: January 05, 2012, 10:07:46 pm »
I've created a Python binding for SFML 2: http://pysfml2-cython.readthedocs.org.
Currently it probably won't compile against the latest SFML 2 version, you'll need to back to before Laurent merged the “drawables” branch intro master. I'll try to fix that this weekend.

71
Python / error: command 'gcc' failed with exit status 1
« on: January 05, 2012, 10:05:55 pm »
You shouldn't use 1.6 in my opinion, it's unmaintained and 2.0 should be released pretty soon, it's already quite stable anyway.
If you choose to use pySFML 2 - Cython, be aware that it probably won't compile with the latest SFML 2 source until I fix it. :? You need to use the SFML source just before when Laurent merged the “drawables” branch.

72
Python / Help with PySFML
« on: December 21, 2011, 05:19:31 pm »
I have uploaded two new binary releases, for Python 2 and Python 3: https://github.com/bastienleonard/pysfml2-cython/downloads. Sorry for the delay.

Feedback is welcome.

73
Python / pysfml2-cython
« on: November 30, 2011, 03:52:01 am »
I have uploaded a new zip file with the standard libs statically linked, it should include all the dependencies now: https://github.com/downloads/bastienleonard/pysfml2-cython/python2-sfml2-cython-win32-nodeps.zip

For some reason, I couldn't the extra_link_args option the setup script, even though it's documented here: http://docs.python.org/distutils/setupscript.html#other-options
Does someone know if extra_link_args works on Windows? (In practice, modify the code to something like setup(extra_link_args=[], **kwargs) in setup.py.)

Quote from: "thisdyingsoul"
Well, I try this:
(in a pyx file)
Code: [Select]

cdef class Obj:      
    def python_method(self):    
        #operations
        pass
   
    cpdef cpython_method(self):
        #operations
        pass

import time

cdef Obj obj = Obj()

i = time.clock()

#cdef int x

for x in range(1000000):
    obj.python_method()

f = time.clock()

print "python_method %f" % (f-i)

i = time.clock()

for x in range(1000000):
    obj.cpython_method()

f = time.clock()

print "cpython_method %f" % (f-i)


I expected a fast loop with cpython_method, but there was only a little speed up. Then uncomment this "#cdef int x" and Voilá. Great speed up!(At least here, hundred of times faster).

I think this is nice i.e. for things like moving the main draw loop (that use Sprite.Draw)  in a cython 'for loop'.( Or any other loop that use a lot of python (slow)method calls)


Thanks, I'll look into that one of these days.

74
Python / Help with PySFML
« on: November 30, 2011, 03:47:06 am »
I have uploaded a new zip that should contain the compiled binding and all the dependencies: https://github.com/downloads/bastienleonard/pysfml2-cython/python2-sfml2-cython-win32-nodeps.zip

Quote from: "Zerralin"
Hello, this is not official but this is how i do

1] Installing MinGW(http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20111118/)
2] Adding MinGW\bin to WINDOWS path(can be added temporary)
4] getting sfml2 by git.
3] Installing cmake
5] launch cmake-gui, select sfml2-source-dir and sfml2-build-dir. Select the mingw generator and Configure->Generate.
7] now alt+r -> cmd -> cd sfml-build-dir -> mingw32-make -> mingw32-make install(as admin)
8] go to sfml_install_dir and copy directories "include" and "lib" to mingw_install_dir.
copy the dll inside bin to windows/system.

Now SFML should works..

PySFML
9] installing python 3.2 32bits
10] installing cython (http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython) Cython-0.15.1.win32-py3.2.‌exe

11] Create distutils.cfg in C:\Python32\Lib\distutils\ if not exists and add
[build]
compiler=mingw32

12] In C:\Python32\Lib\distutils\cygwinccompiler.py from the class MinGW32CCompiler remove all -mno-cygwin

13] Now try to install : alt+r -> cmd -> cd pysfml  and
python setup3k.py build_ext
and finally
python setup.py build_ext install

good luck


The --compiler option doesn't work with Python 3? It's shown in the options list when I use build_ext --help.

Quote from: "kolofsson"
I don't understand why anybody who has windows should bother to compile SFML and PySFML on his own. It's that stupid linux obsession to compile everything.


SFML 2 has no binary release, so I didn't want to make binary release unless necessary. The vast majority of Linux users never compile anything.

Quote from: "kolofsson"
I think using MinGW is bad. Python was compiled in VC++ 2008.


The packager obviously had to choose one compiler, it doesn't mean that the others are bad.

75
Python / pysfml2-cython
« on: November 28, 2011, 08:29:02 pm »
In practice, the generated code is stil in C++, but obviously it needs to call the C/Python API. The vast majority of the methods are just there to map to the C++ equivalent. If someone really wanted to use raw C++, I guess he would call SFML directly.

I thought that cpdef would duplicate every method, but maybe I'm wrong. I should test it and see if it increases the module size.
Cython's documentation says that cdef/cpdef methods are virtual (here), i.e. you will automatically call the most specific method of an object. So I'm not sure whether it bypasses Python method resolution, I thought this was the only thing it could do to make calls faster. :?

Pages: 1 ... 3 4 [5] 6 7 ... 13
anything