Permalink
Browse files

Added ContextSetting to RenderWindow constructor

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...
1 parent f640e3c commit 3e6e7825825c6fb9e13020f3c469441f4503be72 @mkeeter committed May 4, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 sf.pyx
View
@@ -2107,8 +2107,13 @@ cdef class RenderWindow:
cdef decl.RenderWindow *p_this
cdef Input input
- def __cinit__(self, VideoMode mode, char* title, int style=Style.DEFAULT):
- self.p_this = new decl.RenderWindow(mode.p_this[0], title, style)
+ def __cinit__(self, VideoMode mode, char* title, int style=Style.DEFAULT,
+ 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):
self.input = wrap_input_instance(NULL)

0 comments on commit 3e6e782

Please sign in to comment.