There's propably bug in your code. I get black screen and green rectangle with this code, using TButton and TTimer (enabled and 17 interval):
Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
if not nx.Initialized then
nx.CreateGlWindow(self);
end;
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
nx.KillGLWindow;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if not nx.AllOK then exit;
nx.Clear(true, true);
nx.Enable2D(0, 0, nx.Width, nx.Height);
nx.SetColor(0, 1, 0);
nx.RectT(10, 10, 110, 110);
nx.Disable2D;
nx.Flip;
end;
It just took over 1 second to initialize on button click.
Oh, if i recall the picking demo also uses onPaint event after onCreate? You need to do those in the click event too, and not when app initially does Paint first time.
Bookmarks