1
Graphics / Aligning text of different sizes based on the baseline
« on: December 21, 2011, 08:11:50 am »
Well now I feel silly. Works perfectly, thanks!
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.
SetActive is only about drawing. A window needs to be active when you want to draw stuff. So:
- you must call SetActive(false) before launching the rendering thread
- that's all, SetActive(true) is called automatically by Clear/Draw/Display
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using SFML.Graphics;
using SFML.Window;
namespace MessageView
{
class EntryPoint
{
static RenderWindow window = new RenderWindow(new VideoMode(400, 400), "test");
static Thread thread = new Thread(run);
static bool running = true;
static void run()
{
while (running)
{
window.DispatchEvents();
window.Clear();
window.Display();
}
}
static void Main(string[] args)
{
//thread.Start(); //window will immediately disappear
//run(); //runs fine
}
}
}
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
protected RenderWindow window;
public void ForceToFront()
{
SetForegroundWindow(window.SystemHandle);
}