Sanctus Posted March 13, 2010 Share Posted March 13, 2010 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? Quote I create the game you play. I create the rulles you will obey. Link to comment Share on other sites More sharing options...
wh1sp3r Posted March 13, 2010 Share Posted March 13, 2010 yes, you can. Just get Leadwerks window handle and parent it with your form Quote -= 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 More sharing options...
Sanctus Posted March 14, 2010 Author Share Posted March 14, 2010 Thanks man. Do you mind if I ask for some actual code? I can't really find the commands on wiki. Quote I create the game you play. I create the rulles you will obey. Link to comment Share on other sites More sharing options...
wh1sp3r Posted March 14, 2010 Share Posted March 14, 2010 these commands doesn't exist in Leadwerks actually you have to use a Win32 Graphics(WIDTH, HEIGHT); Leadwerks_HWND = GetActiveWindow(); // there should be FindWindow or something, GetActiveWindow in not good, lol SetWindowLongA(Leadwerks_HWND,GWL_STYLE,WS_VISIBLE|WS_CHILDWINDOW); SetWindowPos(Leadwerks_HWND,0,0,0,WIDTH,HEIGHT,0); SetParent(Leadwerks_HWND, (HWND) ANOTHER_HWND); Quote -= 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 More sharing options...
Masterxilo Posted March 14, 2010 Share Posted March 14, 2010 FindWindow is not optimal either in the rare cases where there might exist another window with the same title. Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
Sanctus Posted March 14, 2010 Author Share Posted March 14, 2010 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). Quote I create the game you play. I create the rulles you will obey. Link to comment Share on other sites More sharing options...
Pixel Perfect Posted March 14, 2010 Share Posted March 14, 2010 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. Quote 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 More sharing options...
Recommended Posts
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.