*** empty log message ***

This commit is contained in:
2006-08-10 06:20:12 -04:00
parent 42d1ca9f24
commit 5cb81562d2
7 changed files with 58 additions and 75 deletions

View File

@@ -75,40 +75,7 @@ namespace OpenArena
void Camera::SetViewByMouse(Window window) void Camera::SetViewByMouse(Window window)
{ {
//Remove the ifdef and use the linux section for both linux and windows #if defined USE_GLX
#ifdef __linux
static double currentRotX = 0.0f;
Vec2i pos;
Vec2i middle;
double angleZ;
middle.x = window.GetWidth()/2;
middle.y = window.GetHeight()/2;
pos = window.GetMousePosition();
if(pos != middle)
{
window.SetMousePosition(middle);
angleZ = (middle.y - pos.y)/1000.0;
currentRotX-=angleZ;
if(currentRotX >1.0)
{
currentRotX = 1.0;
}
else if(currentRotX < -1.0)
{
currentRotX = -1.0;
}
else
{
Vec3d axis = (m_vView - m_vPosition).cross(m_vUpVector);
axis.normalize();
RotateView(angleZ, axis.x, axis.y, axis.z);
RotateView((middle.x-pos.x)/1000.0, 0, 1, 0);
//RotateView((middle.x-pos.x)/1000.0, m_vUpVector.x, m_vUpVector.y, m_vUpVector.z);
}
}
#endif
#ifdef __APPLE__
static double currentRotX = 0.0f; static double currentRotX = 0.0f;
Vec2i pos; Vec2i pos;
Vec2i middle; Vec2i middle;
@@ -139,8 +106,11 @@ namespace OpenArena
//RotateView((middle.x-pos.x)/1000.0, m_vUpVector.x, m_vUpVector.y, m_vUpVector.z); //RotateView((middle.x-pos.x)/1000.0, m_vUpVector.x, m_vUpVector.y, m_vUpVector.z);
} }
} }
#endif #elif defined USE_AGL
#ifdef WIN32 #error unimplemented method
#elif defined USE_CGL
#error unimplemented method
#elif defined USE_WGL
static double currentRotX = 0.0f; static double currentRotX = 0.0f;
POINT mpos; POINT mpos;
POINT middle; POINT middle;

View File

@@ -5,23 +5,23 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef WIN32
#include <windows.h> //prolly used for alot but should be removed
#endif
#include <string> #include <string>
#include <fstream> #include <fstream>
#include <cctype> #include <cctype>
#include <cmath> #include <cmath>
#include <iostream> #include <iostream>
#ifdef WIN32
#if defined USE_GLX
#include <GL/gl.h>
#elif defined USE_AGL
#error unimplemented method
#elif defined USE_CGL
#error unimplemented method
#elif defined USE_WGL
#include <windows.h>
#include <GL/gl.h> #include <GL/gl.h>
#endif #endif
#ifdef __linux
#include <GL/gl.h>
#endif
#ifdef __APPLE___
#include <gl.h>
#endif
#include <cstdio> //for file I/O #include <cstdio> //for file I/O
#include "mydefs.h" #include "mydefs.h"

View File

@@ -28,15 +28,15 @@
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifdef __APPLE__ #ifdef __APPLE__
//include necessary header files
#include "main.h" #include "main.h"
#include "version.h" #include "version.h"
//include necessary header files
using namespace std; using namespace std;
//void InitControls();
unsigned char TranslateKey(int keyCode); unsigned char TranslateKey(int keyCode);
unsigned char TranslateButton(int keyCode); unsigned char TranslateButton(int keyCode);
#if defined USE_GLX
//void InitControls();
void HandleConsoleKeyPress(OpenArena::Keys key); void HandleConsoleKeyPress(OpenArena::Keys key);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -885,5 +885,10 @@ void HandleConsoleKeyPress(OpenArena::Keys key)
} }
} }
} }
#elif defined USE_AGL
#error
#elif defined USE_CGL
#error
#endif
#endif #endif

View File

@@ -1 +1,10 @@
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#include <AGL/agl.h>
#include <OpenGL/gl.h>
/*
OSStatus main(int argc, char** argv)
{
}
*/

View File

@@ -5,22 +5,20 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef WIN32 #if defined USE_GLX
#include <windows.h> // Header file for windows #include <GL/gl.h> // Header file for OpenGL32 library
#include <GL/glu.h> // Header file for Glu32 library
#elif defined USE_AGL
#error unimplemented method
#elif defined USE_CGL
#error unimplemented method
#elif defined USE_WGL
#include <windows.h>
#include <GL/gl.h> // Header file for OpenGL32 library
#include <GL/glu.h> // Header file for Glu32 library
#endif #endif
#include <cstdio> // Header file for standard input/output #include <cstdio> // Header file for standard input/output
#ifdef WIN32
#include <GL/gl.h> // Header file for OpenGL32 library
#include <GL/glu.h> // Header file for Glu32 library
#endif
#ifdef __linux
#include <GL/gl.h> // Header file for OpenGL32 library
#include <GL/glu.h> // Header file for Glu32 library
#endif
#ifdef __APPLE__
#include <GL/gl.h> // Header file for OpenGL32 library
#include <GL/glu.h> // Header file for Glu32 library
#endif
#include <math.h> #include <math.h>
#include "camera.h" #include "camera.h"

View File

@@ -5,20 +5,19 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef WIN32 #if defined USE_GLX
#include <windows.h> //Remove if possible #include <GL/gl.h>
#include <GL/glu.h>
#elif defined USE_AGL
#error unimplemented method
#elif defined USE_CGL
#error unimplemented method
#elif defined USE_WGL
#include <windows.h>
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
#endif #endif
#ifdef __linux
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#ifdef __APPLE__
#include <GL/gl.h>
#include <GL/glu.h>
#endif
//#include <gl/glaux.h> //Hopefully nothing needs this remove if it works in windows
#include <string> #include <string>
#include "datatypes.h" #include "datatypes.h"
#include "screen.h" #include "screen.h"

View File

@@ -39,7 +39,9 @@ void OpenArena::Window::Close()
XCloseDisplay(display); XCloseDisplay(display);
#elif defined USE_AGL #elif defined USE_AGL
#error unimplemented method
#elif defined USE_CGL #elif defined USE_CGL
#error unimplemented method
#elif defined USE_WGL #elif defined USE_WGL
if(_fullscreen) if(_fullscreen)
{ {