mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-09 13:44:32 +00:00
update bullet so it actually works
Moved the addSourceDirectory for physics/Bullet into the Engine/Source/CMakeLists.txt file that way it can actually appear where we expect it to in the solution explorer.
This commit is contained in:
parent
c7be48130a
commit
13fa178cf6
5986 changed files with 1811270 additions and 453803 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#ifndef B3_USE_GLFW
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
Copyright (c) 2012 Advanced Micro Devices, Inc.
|
||||
|
|
@ -14,7 +15,6 @@ subject to the following restrictions:
|
|||
*/
|
||||
//Originally written by Erwin Coumans
|
||||
|
||||
|
||||
#include "Win32OpenGLWindow.h"
|
||||
|
||||
#include "OpenGLInclude.h"
|
||||
|
|
@ -23,129 +23,100 @@ subject to the following restrictions:
|
|||
|
||||
#include "Win32InternalWindowData.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static void printGLString(const char *name, GLenum s) {
|
||||
const char *v = (const char *) glGetString(s);
|
||||
printf("%s = %s\n",name, v);
|
||||
}
|
||||
|
||||
bool sOpenGLVerbose = true;
|
||||
#include <stdlib.h>
|
||||
|
||||
void Win32OpenGLWindow::enableOpenGL()
|
||||
{
|
||||
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
int format;
|
||||
|
||||
|
||||
// get the device context (DC)
|
||||
m_data->m_hDC = GetDC( m_data->m_hWnd );
|
||||
|
||||
m_data->m_hDC = GetDC(m_data->m_hWnd);
|
||||
|
||||
// set the pixel format for the DC
|
||||
ZeroMemory( &pfd, sizeof( pfd ) );
|
||||
pfd.nSize = sizeof( pfd );
|
||||
ZeroMemory(&pfd, sizeof(pfd));
|
||||
pfd.nSize = sizeof(pfd);
|
||||
pfd.nVersion = 1;
|
||||
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
|
||||
pfd.iPixelType = PFD_TYPE_RGBA;
|
||||
pfd.cColorBits = 32;
|
||||
pfd.cRedBits = 8;
|
||||
pfd.cGreenBits = 8;
|
||||
pfd.cBlueBits = 8;
|
||||
pfd.cAlphaBits = 8;
|
||||
pfd.cGreenBits = 8;
|
||||
pfd.cBlueBits = 8;
|
||||
pfd.cAlphaBits = 8;
|
||||
|
||||
pfd.cDepthBits = 24;
|
||||
pfd.cStencilBits = 8;//1;
|
||||
pfd.cStencilBits = 8; //1;
|
||||
pfd.iLayerType = PFD_MAIN_PLANE;
|
||||
format = ChoosePixelFormat( m_data->m_hDC, &pfd );
|
||||
SetPixelFormat( m_data->m_hDC, format, &pfd );
|
||||
|
||||
format = ChoosePixelFormat(m_data->m_hDC, &pfd);
|
||||
SetPixelFormat(m_data->m_hDC, format, &pfd);
|
||||
|
||||
// create and enable the render context (RC)
|
||||
m_data->m_hRC = wglCreateContext( m_data->m_hDC );
|
||||
wglMakeCurrent( m_data->m_hDC, m_data->m_hRC );
|
||||
|
||||
if (sOpenGLVerbose)
|
||||
{
|
||||
printGLString("Version", GL_VERSION);
|
||||
printGLString("Vendor", GL_VENDOR);
|
||||
printGLString("Renderer", GL_RENDERER);
|
||||
}
|
||||
//printGLString("Extensions", GL_EXTENSIONS);
|
||||
m_data->m_hRC = wglCreateContext(m_data->m_hDC);
|
||||
wglMakeCurrent(m_data->m_hDC, m_data->m_hRC);
|
||||
|
||||
//printGLString("Extensions", GL_EXTENSIONS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Win32OpenGLWindow::disableOpenGL()
|
||||
{
|
||||
wglMakeCurrent( NULL, NULL );
|
||||
wglDeleteContext( m_data->m_hRC );
|
||||
// ReleaseDC( m_data->m_hWnd, m_data->m_hDC );
|
||||
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
wglDeleteContext(m_data->m_hRC);
|
||||
// ReleaseDC( m_data->m_hWnd, m_data->m_hDC );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Win32OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
|
||||
void Win32OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
|
||||
{
|
||||
Win32Window::createWindow(ci);
|
||||
|
||||
//VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem, this);
|
||||
enableOpenGL();
|
||||
|
||||
if (!gladLoaderLoadGL())
|
||||
{
|
||||
printf("gladLoaderLoadGL failed!\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Win32OpenGLWindow::Win32OpenGLWindow()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
Win32OpenGLWindow::~Win32OpenGLWindow()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Win32OpenGLWindow::closeWindow()
|
||||
void Win32OpenGLWindow::closeWindow()
|
||||
{
|
||||
disableOpenGL();
|
||||
|
||||
Win32Window::closeWindow();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Win32OpenGLWindow::startRendering()
|
||||
void Win32OpenGLWindow::startRendering()
|
||||
{
|
||||
pumpMessage();
|
||||
//don't clear all 3 buffers because some AMD drivers are buggy
|
||||
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
pumpMessage();
|
||||
|
||||
//glCullFace(GL_BACK);
|
||||
//glFrontFace(GL_CCW);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
//glCullFace(GL_BACK);
|
||||
//glFrontFace(GL_CCW);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
|
||||
void Win32OpenGLWindow::renderAllObjects()
|
||||
void Win32OpenGLWindow::renderAllObjects()
|
||||
{
|
||||
}
|
||||
|
||||
void Win32OpenGLWindow::endRendering()
|
||||
{
|
||||
SwapBuffers( m_data->m_hDC );
|
||||
|
||||
void Win32OpenGLWindow::endRendering()
|
||||
{
|
||||
SwapBuffers(m_data->m_hDC);
|
||||
}
|
||||
|
||||
int Win32OpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength)
|
||||
{
|
||||
#if 0
|
||||
//wchar_t wideChars[1024];
|
||||
|
||||
OPENFILENAME ofn ;
|
||||
|
|
@ -165,7 +136,7 @@ int Win32OpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength)
|
|||
ofn.nMaxFile = 1023;
|
||||
//ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
|
||||
ofn.lpstrFilter = "All Files\0*.*\0URDF\0*.urdf\0.bullet\0*.bullet\0";
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
ofn.nFilterIndex =1;
|
||||
|
|
@ -175,9 +146,9 @@ int Win32OpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength)
|
|||
ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST ;
|
||||
GetOpenFileName( &ofn );
|
||||
return strlen(fileName);
|
||||
|
||||
|
||||
//return 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int Win32OpenGLWindow::getWidth() const
|
||||
|
|
@ -191,10 +162,9 @@ int Win32OpenGLWindow::getHeight() const
|
|||
{
|
||||
if (m_data)
|
||||
return m_data->m_openglViewportHeight;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif //B3_USE_GLFW
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue