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

Pages: [1]
1
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?

2
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)

3
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?

4
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

5
Feature requests / Additional graphic layer render backends
« on: August 13, 2009, 01:33:55 pm »
DirectX, Xlib, windib, framebuffer ?

(+ 8bpp/palette functionality)

Reason is for 'legacy' hardware performance issues...

For example, I have an old COMPAQ PRESARIO 5140..
Windows 2000 Professional
400 Mhz Pentium II
384 Mb RAM
4 MB ATI 3D Rage LT Pro AGP 2x

It has OpenGL 'support', but is *extremely* slow. Rendering a -single- small sprite once per frame results in only 13 FPS... Whereas if I use SDL (which uses either the windib/DirectX backend, not sure at this point) I can blit about 600 sprites per frame at a constant 20 FPS.

Just saying. :D

6
Python / sf.so
« on: August 12, 2009, 11:18:16 pm »
Where's the source to the compiled dynamic library sf.so ?

Pages: [1]