Esempio n. 1
0
 public ResourceContext(ResourceContext rc)
 {
     m_DC  = rc.m_DC;
     m_hRC = IntPtr.Zero;
     if (m_DC == null || m_DC.Disposed)
     {
         return;
     }
     m_hRC = WGL.CreateContext(m_DC.Handle);
     if (m_hRC != IntPtr.Zero)
     {
         m_DC.BeforeReleaseEvent += OnBeforeDeviceContextRelease;
         WGL.ShareLists(rc.m_hRC, m_hRC);
     }
 }
Esempio n. 2
0
 public ResourceContext(DeviceContext dc)
 {
     m_DC  = dc;
     m_hRC = IntPtr.Zero;
     if (m_DC == null || m_DC.Disposed)
     {
         GameDebugger.EngineLog(LogLevel.Error, "Device context cannot be used to create an OpenGL resource context");
         return;
     }
     m_hRC = WGL.CreateContext(m_DC.Handle);
     if (m_hRC != IntPtr.Zero)
     {
         m_DC.BeforeReleaseEvent += OnBeforeDeviceContextRelease;
     }
     else
     {
         // GameDebugger.EngineLog(LogLevel.Error, "Trying to create a resouce context returned a null handle. Error was: {0}", GL.GetError());
         GameDebugger.EngineLog(LogLevel.Error, "Trying to create a resouce context returned a null handle. Error was: {0}", IGE.Platform.Win32.API.Externals.GetLastError());
     }
 }