Skip to content

Commit

Permalink
Added ContextSetting to RenderWindow constructor
Browse files Browse the repository at this point in the history
This commit adds an optional ContextSetting parameter to the RenderWindow
constructor.  This allows you to initialize a window with antialiasing,
rather than having to use RenderWindow.create (which hasn't worked for me).
  • Loading branch information
mkeeter committed May 4, 2011
1 parent f640e3c commit 3e6e782
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sf.pyx
Expand Up @@ -2107,8 +2107,13 @@ cdef class RenderWindow:
cdef decl.RenderWindow *p_this cdef decl.RenderWindow *p_this
cdef Input input cdef Input input


def __cinit__(self, VideoMode mode, char* title, int style=Style.DEFAULT): def __cinit__(self, VideoMode mode, char* title, int style=Style.DEFAULT,
self.p_this = new decl.RenderWindow(mode.p_this[0], title, style) ContextSettings settings=None):
if settings is None:
self.p_this = new decl.RenderWindow(mode.p_this[0], title, style)
else:
self.p_this = new decl.RenderWindow(mode.p_this[0], title, style,
settings.p_this[0])


def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.input = wrap_input_instance(NULL) self.input = wrap_input_instance(NULL)
Expand Down

0 comments on commit 3e6e782

Please sign in to comment.