Is it possible to use both Direct X and OpenGL on the same window? I have been maintaining a game called Original War since 2005, but Altar (The developers) used Direct X. Id like to put a better menu system in Original War but id like to do it with OpenGL (As thats what im familure with) but moving the whole game over to OpenGL would take too long(Im not getting payed after all).
So im basically wondering if its possible to have DirectX draw on a window and then have OpenGL draw on top of that.
Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Sounds like a bad idea. OpenGL and DirectX use a different coordinate system, but that is the least of your problems. Both use its own hardware accelerated context so you cannot make a few directx calls end mix them with opengl calls in the same window. So your best guess is a wrapper that translates opengl commands to directx calls. But ... There are some wrappers to provide directx calls to opengl but no the other way around. But there is the webgl project on google bringing an api to use opengles 2.0 calls on directx9: http://code.google.com/p/angleproject/ Hope that may be of help.
I should have proberly been clearer. By window i meant the actual window rather than whats created with CreateWindow/CreateWindowEx. So DirectX "Window" as the parent with an OGL Child "Window".
With my limited research WS_EX_COMPOSITED and WS_EX_TRANSPARENT sound promising but they don't want to work with Original War(WS_EX_COMPOSITED makes Original War's Main CreateWindowEx fail).
Zitat:
Both use its own hardware accelerated context so you cannot make a few directx calls end mix them with opengl calls in the same window.
You can, though one overwrites the other so you get alot of flicker.
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
Stucuk hat geschrieben:
I should have proberly been clearer. By window i meant the actual window rather than whats created with CreateWindow/CreateWindowEx.
I do not really see a difference.
But you wont have any chance with composited/layered/transparent/whatever windows, they will all flicker above a hardware accelerated window. At least on WinXP they did, not sure whether the new window management in Vista/7 can handle that.
greetings
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
I guess i could just have two windows without any transparency and show/hide only one of the windows based on if the game is in a menu or the actual game section. Only negative is that the actual game bit's GUI couldn't use the OGL system.
Is there any way to convert a 16bit buffer to 32bit and visa versa in a fast way? The following (Which i never wrote or understand) is too slow for real-time usage. I assume there is no fast way but im still hopeful.
Code:
procedure Copy16to32(Source,Dest:Pointer;WidthInPixels:Integer);stdcall; asm pushad mov esi,Source mov edi,Dest mov ecx,WidthInPixels @dalsi: mov ax,[esi] mov bx,ax and ax,$1F shl ax,3 or ax,7 shrd edx,eax,8 mov ax,bx and ax,$7E0 shr ax,3 or ax,3 shrd edx,eax,8 mov ax,bx and ax,$F800 shr ax,8 or ax,7 shrd edx,eax,8 shr edx,8 mov [edi],edx add esi,2 add edi,4 dec ecx jnz @dalsi popad end;
Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.