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

Pages: [1] 2
1
Python / OpenGL?
« on: August 14, 2009, 02:56:22 am »
Ah, nevermind .. glClearColor needs to be passed in floats ;)

2
Python / OpenGL?
« on: August 14, 2009, 01:34:35 am »
Hey.. I'm encountering a strange problem intermixing OpenGL into PySFML code..

I'm using two methods..

The first: directly accessing GL using ctypes
The second: accessing GL through PyOpenGL (which directly accesses GL using ctypes)

Other than the method for importing the GL lib, the code is the same.. but the first method fails...

First:

Code: [Select]
from ctypes import CDLL
from ctypes.util import find_library, sys
if sys.platform == 'win32': GL = CDLL( find_library( 'opengl32' ) )
else: GL = CDLL( find_library( 'GL' ) )

from PySFML import sf
window = sf.RenderWindow( sf.VideoMode( 800, 600 ), 'title' )
GL.glClearColor( 255, 0, 0, 255 )
while True:
    GL.glClear( 0x00004000 ) # mask == GL_COLOR_CLEAR_VALUE
    window.Display()



Second:

Code: [Select]
from OpenGL import GL

from PySFML import sf
window = sf.RenderWindow( sf.VideoMode( 800, 600 ), 'title' )
GL.glClearColor( 255, 0, 0, 255 )
while True:
    GL.glClear( 0x00004000 ) # mask == GL_COLOR_CLEAR_VALUE
    window.Display()


Basically, the first results in a constant BLACK window while the second results in a constant RED window, as expected.

The glClear() call in the first example obviously 'works' because the window is getting cleared, but it's not the correct color.

PyOpenGL at http://pyopengl.sourceforge.net/

Again, PyOpenGL accesses OpenGL via ctypes as I'm trying to do on a lower level, so this must be possible, *somehow*.

My ideas are that glClearColor() might be failing to set the color for some reason, or PyOpenGL is doing some essential initializations that I'm missing..

I'll be looking through PyOpenGL source until I figure this out.

Any ideas?

3
Python / Python,... bindings
« on: August 13, 2009, 11:34:47 pm »
I'm working on a project that will redistribute SFML with a custom import method ... I'll post about it in the projects section when I reach the next milestone; keep on the lookout.

Basically the point is to have a single distribution of the libs that works across all supported archs (32/64bit), systems (w32/linux/mac) and python versions(2.5,2.6,3.0) with a single simplified import procedure.

Note, only supporting the officially available binaries.. So if more are added / updated, I will synchronize my system.

5
Feature requests / Iconify and fullscreen toggle
« on: August 13, 2009, 11:16:20 pm »
Nope, not here; on w32: yes.

When in fullscreen the app gets like an 'exclusive' WM lock.. Other normal WM key commands don't have any effect such as Alt+Tab, or Alt+F4, etc.

On w32, Alt+Tab, Alt+F4,  the 'start menu' key, and etc all still work so the app doesn't have such an 'exclusive' lock.

6
Feature requests / Iconify and fullscreen toggle
« on: August 13, 2009, 08:50:35 pm »
Akin to:

http://www.libsdl.org/cgi/docwiki.cgi/SDL_WM_IconifyWindow

http://www.libsdl.org/cgi/docwiki.cgi/SDL_WM_ToggleFullScreen

Obviously the fullscreen toggle can be implemented by SFML end-user easily with Window.Create... But I'm not sure how to handle minimizing. (Useful for fullscreen windows when hitting Alt+Tab)

7
Window / Bad Events
« on: August 13, 2009, 08:45:44 pm »
Here are some results from the `xev` Event Tester...

Code: [Select]
KeyPress event, serial 30, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2549350, (272,477), root:(1556,583),
    state 0x0, keycode 49 (keysym 0x60, grave), same_screen YES,
    XLookupString gives 1 bytes: (60) "`"
    XmbLookupString gives 1 bytes: (60) "`"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2556537, (272,477), root:(1556,583),
    state 0x0, keycode 90 (keysym 0xff9e, KP_Insert), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2556896, (272,477), root:(1556,583),
    state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2557177, (272,477), root:(1556,583),
    state 0x0, keycode 88 (keysym 0xff99, KP_Down), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2557556, (272,477), root:(1556,583),
    state 0x0, keycode 89 (keysym 0xff9b, KP_Next), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2558058, (272,477), root:(1556,583),
    state 0x0, keycode 83 (keysym 0xff96, KP_Left), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2558355, (272,477), root:(1556,583),
    state 0x0, keycode 84 (keysym 0xff9d, KP_Begin), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2558652, (272,477), root:(1556,583),
    state 0x0, keycode 85 (keysym 0xff98, KP_Right), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2559200, (272,477), root:(1556,583),
    state 0x0, keycode 79 (keysym 0xff95, KP_Home), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2559541, (272,477), root:(1556,583),
    state 0x0, keycode 80 (keysym 0xff97, KP_Up), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2559879, (272,477), root:(1556,583),
    state 0x0, keycode 81 (keysym 0xff9a, KP_Prior), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2563542, (272,477), root:(1556,583),
    state 0x0, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2564335, (272,477), root:(1556,583),
    state 0x10, keycode 49 (keysym 0x60, grave), same_screen YES,
    XLookupString gives 1 bytes: (60) "`"
    XmbLookupString gives 1 bytes: (60) "`"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2564950, (272,477), root:(1556,583),
    state 0x10, keycode 90 (keysym 0xffb0, KP_0), same_screen YES,
    XLookupString gives 1 bytes: (30) "0"
    XmbLookupString gives 1 bytes: (30) "0"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2565238, (272,477), root:(1556,583),
    state 0x10, keycode 87 (keysym 0xffb1, KP_1), same_screen YES,
    XLookupString gives 1 bytes: (31) "1"
    XmbLookupString gives 1 bytes: (31) "1"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2565515, (272,477), root:(1556,583),
    state 0x10, keycode 88 (keysym 0xffb2, KP_2), same_screen YES,
    XLookupString gives 1 bytes: (32) "2"
    XmbLookupString gives 1 bytes: (32) "2"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2565791, (272,477), root:(1556,583),
    state 0x10, keycode 89 (keysym 0xffb3, KP_3), same_screen YES,
    XLookupString gives 1 bytes: (33) "3"
    XmbLookupString gives 1 bytes: (33) "3"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2566160, (272,477), root:(1556,583),
    state 0x10, keycode 83 (keysym 0xffb4, KP_4), same_screen YES,
    XLookupString gives 1 bytes: (34) "4"
    XmbLookupString gives 1 bytes: (34) "4"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2566436, (272,477), root:(1556,583),
    state 0x10, keycode 84 (keysym 0xffb5, KP_5), same_screen YES,
    XLookupString gives 1 bytes: (35) "5"
    XmbLookupString gives 1 bytes: (35) "5"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2566728, (272,477), root:(1556,583),
    state 0x10, keycode 85 (keysym 0xffb6, KP_6), same_screen YES,
    XLookupString gives 1 bytes: (36) "6"
    XmbLookupString gives 1 bytes: (36) "6"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2567071, (272,477), root:(1556,583),
    state 0x10, keycode 79 (keysym 0xffb7, KP_7), same_screen YES,
    XLookupString gives 1 bytes: (37) "7"
    XmbLookupString gives 1 bytes: (37) "7"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2567343, (272,477), root:(1556,583),
    state 0x10, keycode 80 (keysym 0xffb8, KP_8), same_screen YES,
    XLookupString gives 1 bytes: (38) "8"
    XmbLookupString gives 1 bytes: (38) "8"
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x4400001,
    root 0x1a6, subw 0x0, time 2567681, (272,477), root:(1556,583),
    state 0x10, keycode 81 (keysym 0xffb9, KP_9), same_screen YES,
    XLookupString gives 1 bytes: (39) "9"
    XmbLookupString gives 1 bytes: (39) "9"
    XFilterEvent returns: False


Basically, I hit the following keys in the following order (on the Numpad, plus Tilde and Num_lock):
Quote
Tilde,0,1,2,3,4,5,6,7,8,9,Num_lock,Tilde,0,1,2,3,4,5,6,7,8,9


Say if you need more info.

Also, I noticed there's no SFML Key definition for Num_Lock.

8
Window / Bad Events
« on: August 13, 2009, 08:18:40 pm »
Debian & 1.5

9
Window / Bad Events
« on: August 13, 2009, 07:54:26 pm »
Further note... if I have NumLk enabled then it registers the numpad keys, otherwise it doesn't. (Tilde always return 0)

10
Window / Bad Events
« on: August 13, 2009, 07:40:52 pm »
Hmm.. when I press Tilde or Numpad keys, they register as an event with Event.Type == Event.KeyPressed but their Key.Code == 0 ?

No matter which numpad I press, tab also.. all == 0 ?

This seems similar to a fault with GLUT I used to encounter.. basically, GLUT didn't register a keypress for numpad keys at all. At least SFML registers them but they are 0.. any idea why?

11
Python / sf.so
« on: August 13, 2009, 05:34:19 pm »
Not that I care much for it.. I just think the Python interface should mirror the C++ interface as closely as possible...

Including thread/mutex, because SFML's interface is different than python's stdlib. Even if the PySFML thread/mutex is just a wrapper for the python stdlib methods.. Just so documentation is unambiguous.

12
Python / sf.so
« on: August 13, 2009, 04:34:47 pm »
Ah, I see.. main.cpp ;)

What about Vectors? Sure it would be easy to implement in python but same with C++

13
SFML website / Window.Close
« on: August 13, 2009, 04:33:29 pm »
http://sfml-dev.org/documentation/1.5/classsf_1_1Window.htm#b04439f6fb9fdfe40f882676fdb2938c

"The sf::Window instance remains valid and you can call Create to recreate the window"

repeats twice? :D

14
Feature requests / Automatic key repeat
« on: August 13, 2009, 04:08:58 pm »
What about setting up a delay and interval like at http://www.libsdl.org/cgi/docwiki.cgi/SDL_EnableKeyRepeat ?

15
Feature requests / Additional graphic layer render backends
« on: August 13, 2009, 03:29:10 pm »
Yeah, I suppose adding extra backends would change the 'S' in 'SFML' from 'Simple' to 'Super'. :D

Pages: [1] 2