For some reason I can't get a polygon to draw, it only shows a blank screen.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFML;
using SFML.Window;
using SFML.Graphics;
namespace MusicSFML
{
class World
{
Shape polygon = new Shape();
public RenderWindow renderWindow = new RenderWindow(new VideoMode(1280, 720, 32), "Look at this it may even work");
public World()
{
renderWindow.Closed += new EventHandler(OnClosed);
renderWindow.KeyPressed += new EventHandler<KeyEventArgs>(OnKeyPressed);
polygon.AddPoint(new Vector2(10, 10), Color.Black);
polygon.AddPoint(new Vector2(50, 10), Color.Black);
polygon.AddPoint(new Vector2(50, 30), Color.Black);
polygon.AddPoint(new Vector2(10, 30), Color.Black);
polygon.Color = Color.Black;
polygon.EnableFill(true);
polygon.EnableOutline(true);
}
public void Think()
{
// Proccess events
renderWindow.DispatchEvents();
float frameTime = renderWindow.GetFrameTime();
}
public void Draw()
{
renderWindow.Clear(Color.White);
renderWindow.Draw(polygon);
}
void OnClosed(object sender, EventArgs e)
{
RenderWindow window = (RenderWindow)sender;
window.Close();
}
void OnKeyPressed(object sender, KeyEventArgs e)
{
RenderWindow window = (RenderWindow)sender;
if (e.Code == KeyCode.Escape)
window.Close();
}
}
}