Creating an opengl demo/game in VB??

Started by
12 comments, last by Blade Runner 22 years, 4 months ago
Heh, indeed.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Advertisement
quote:I''ve just been playing with Excel, and it''s impossible to set up a device context to
render to - So the answer is no, you can''t create OpenGL games in VBA!


Why? AFAIK VBA can export functions from dlls, so find Userform''s window using WinAPI functions and then initialize ogl , smth like:

Declare Function wglCreateContext(hdc As Long) Lib "opengl32.dll" As Long

Another way is to use some stuff written on more serious language and compiled into DLL or ActiveX component.

I''ve inserted OpenGL 3D button into Excel''s VBA, recieved events on it''s clicks and changed it''s apearance using our Indirect3D/Fastfruit ActiveX component. But now it''s not yet suitable for writting games.
If anybody is interested I can tell more about it.
How did you get the UserForm hWnd?
From WinAPI Help:
quote:
The GetActiveWindow function retrieves the window handle to the active window associated with the thread that calls the function.

HWND GetActiveWindow(VOID)


Antoher function can give a hWnd of ANY window(I''ve got hWnd of Excel from Delphi):

HWND GetForegroundWindow(VOID);


This topic is closed to new replies.

Advertisement