PDA

View Full Version : HNDL of TBGL_CreateWindow



ErosOlmi
23-09-2005, 11:03
Eros first request ------------
--------------------------------

Petr,

can you please change TBGL_CreateWindow in a way it will return the handle of the window?

After release of version 1.0.5.0 we will work a bit on user interface.
The first think we will add will be window message pump so if TBGL_CreateWindow returns the handle we can start trying pumping keyboard messages. In this way GL windows can be used without the need to open a console for keyboard input.

Thanks
Eros


Petr reply ------------
-------------------------
Hmm, there is a little problem with the handle.

The function TBGL_CreateWindow looks like this:



FUNCTION Exec_TBGL_CreateWindow() AS LONG

LastBindedTexture = -1

DIALOG NEW %HWND_DESKTOP, "thinBasic OpenGL console",,, 320, 240, _
%WS_CAPTION OR %WS_SYSMENU OR %DS_CENTER OR %WS_THICKFRAME TO hDlg

CONTROL ADD LABEL, hDlg, %IDPIC,"",0,0,320,240, %WS_CHILD OR %WS_VISIBLE OR %SS_SUNKEN

DIALOG SHOW MODELESS hDlg CALL DlgProc

END FUNCTION

I don't know how to make this function return anything before it ends
( It stops at DIALOG SHOW processing messages by DlgProc )

I can write function TBGL_GetWindowHandle of course

Psch

Eros reply ------------
-------------------------
First all functions returning a number should return an EXT number and not a LONG even if the number is a LONG class.

To solve the problem, you should separate creation of the dialog by showing of the window and make 1 new thinBasic keyword.

So FUNCTION Exec_TBGL_CreateWindow() AS EXT will create the dialog and return it's hadle. Than create FUNCTION Exec_TBGL_ShowWindow() AS EXT in charge of showing the dialog connected with new keyword "TBGL_ShowWindow". This new function should parse also the hadle. Also I think all TBGL functions should have the handle as first parameter and this should permit to make and control more than one GL window.

I will copy this thread into beta forum so Roberto can also follow it and maybe correct me if I'm wrong.

Eros

Petr Schreiber
23-09-2005, 11:18
Thanks for suggestions,

AS LONG problem is fixed now, TBGL_CreateWindow returns handle and TBGL_ShowWindow shows this window

Support for multiple windows is interesting idea, but bit difficult to implement now. I will consider it for release 0.1.5+


Thanks,
Psch