Jump to content

Attaching LE to a HWND?


Sanctus
 Share

Recommended Posts

Hey guys.

I decided to start a project using LE 2.22 untill Josh get's back and I can buy LE 2.3

 

Anyway thing is I need to use Leadwerks in a windows forms application.

I think I'll write my own C# headers for this but first I'd like to know (in c++) how can I start the engine using a HWND or in a way that I can use it over a custrom controll.

In my own engine(not public) I have CreateEngine(HWND hwnd,int renderer) and CreateEngineWindow(int width,int height,int depth,int renderer). (note that I don't want to brag about it)

Can I do something similar here?

I create the game you play. I create the rulles you will obey.

Link to comment
Share on other sites

these commands doesn't exist in Leadwerks actually :) you have to use a Win32 :P

 

Graphics(WIDTH, HEIGHT);

Leadwerks_HWND = GetActiveWindow(); // there should be FindWindow or something, GetActiveWindow in not good, lol :D

SetWindowLongA(Leadwerks_HWND,GWL_STYLE,WS_VISIBLE|WS_CHILDWINDOW);

SetWindowPos(Leadwerks_HWND,0,0,0,WIDTH,HEIGHT,0);

SetParent(Leadwerks_HWND, (HWND) ANOTHER_HWND);

-= Phenom II X4 965 3.4Ghz - ATI HD5870 - 6 GB DDR3 RAM - Windows 8 Pro 64x=-

Website: http://www.flamewarestudios.com

Link to comment
Share on other sites

Yeah but doesn't leadwerks support this natively?

I mean I basically want to do what's in the sandbox.

I don't want to add a parent to the actual window. I want to put it in another window as a control. I'm sorry if this is stupid but my win32 programming skills are close to none( I can make a window with a button and that's all).

I create the game you play. I create the rulles you will obey.

Link to comment
Share on other sites

From my understanding so long as you can create an OpenGL viewport in your application then Leadwerks will render to this using a custom buffer. TylerH has done this before in C# and posted code in the past so you might want to do some searching of probably the old forum

 

I'm using the same technique of parenting the Leadwerks window that wh1sp3r suggested but it's not ideal.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...