Updated CSFML and SFML.Net in the sfml2 branch
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1233 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
fc22927874
commit
7f4de9033c
15 changed files with 164 additions and 42 deletions
|
@ -15,6 +15,9 @@ namespace sample_window
|
|||
// Create the main window
|
||||
Window window = new Window(new VideoMode(640, 480, 32), "SFML.Net Window");
|
||||
|
||||
// Activate it as the target for OpenGL calls
|
||||
window.SetActive();
|
||||
|
||||
// Setup event handlers
|
||||
window.Closed += new EventHandler(OnClosed);
|
||||
window.KeyPressed += new EventHandler<KeyEventArgs>(OnKeyPressed);
|
||||
|
@ -42,8 +45,6 @@ namespace sample_window
|
|||
window.DispatchEvents();
|
||||
|
||||
// Set the active window before using OpenGL commands
|
||||
// It's useless here because the active window is always the same,
|
||||
// but don't forget it if you use multiple windows
|
||||
window.SetActive();
|
||||
|
||||
// Clear color and depth buffer
|
||||
|
@ -128,6 +129,8 @@ namespace sample_window
|
|||
/// </summary>
|
||||
static void OnResized(object sender, SizeEventArgs e)
|
||||
{
|
||||
Window window = (Window)sender;
|
||||
window.SetActive();
|
||||
Gl.glViewport(0, 0, (int)e.Width, (int)e.Height);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue