machoman811 Posted December 8, 2009 Posted December 8, 2009 Hi guys! Any idea how to replace the lw's Graphics() fct? I can't make it work without it since I don't know how to set it up properly without it (bacbuffer, etc). If I remove the line, I can create meshes but nothing that relates to textures. If I do call LoadTexture for instance, I get a msgbox "OpenGL Error - GL_INVALID_VALUE". Also, the backbuffer's height and width are 0. I'm using tao and vs2008 and a SimpleOpenglcontrol in my form. This is my c# code: m_iWidth = mgr.GetDataInt("OpengGLWindowWidth", DEFAULT_OGL_WIDTH); m_iHeight = mgr.GetDataInt("OpengGLWindowHeight", DEFAULT_OGL_HEIGHT); string strFakeAppTitle = mgr.GetDataString("FakeAppTitle", DEFAULT_FAKE_APP_TITLE); OpenGLControl.InitializeContexts(); /////////////////////// // We're initializing the window just because I can't seem to init all needed stuff in // lw to make the textures and meshes work. Leadwerks.Engine.Leadwerks.SetAppTitle(strFakeAppTitle); Leadwerks.Engine.Leadwerks.Graphics(m_iWidth, m_iHeight, 0, 0, Leadwerks.Engine.Leadwerks.GRAPHICS_BACKBUFFER|Leadwerks.Engine.Leadwerks.GRAPHICS_DEPTHBUFFER); // hide the window right away -- HACK!!! int hWnd; Process[] processRunning = Process.GetProcesses(); foreach (Process pr in processRunning) { if (pr.MainWindowTitle == strFakeAppTitle) { hWnd = pr.MainWindowHandle.ToInt32(); ShowWindow(hWnd, 0); } } ////////////////////////// // setup leadwerks path string strAbstractPath = mgr.GetDataString("AbstractPath", Application.StartupPath); Leadwerks.Engine.Leadwerks.RegisterAbstractPath(strAbstractPath); // Create our custom buffer OpenGLControl.MakeCurrent(); // this has to be done before calling leadwerks stuff.. m_World_fake = Leadwerks.Engine.Leadwerks.CreateWorld(); // Create world m_buffer = Leadwerks.Engine.Leadwerks.CreateCustomBuffer(DGetSize, DMakeCurrent); Leadwerks.Engine.Leadwerks.SetBuffer(m_buffer); Quote
L B Posted December 9, 2009 Posted December 9, 2009 I think Graphics() does much more than just a normal initialization. Contact Josh about this, I'm no help with C# in this case. Quote
machoman811 Posted December 9, 2009 Author Posted December 9, 2009 Yeah, it does more than just init, it creates a window and stuff like that. I would like to init without having to create a window. It's not that big of an issue since I did a work around but I still would like to make it properly. Quote
TylerH Posted December 14, 2009 Posted December 14, 2009 Download the BMX demo and take a look at the source code to their OpenGL Module, it shows you the meat of the Graphics call, which has its root in C/C++ calls on the Windows API to create a window, setup a context, etc. It basically does what any tutorial on OpenGL basics shows you how to do with regards to a window and context. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer -----
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.