mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 16:20:27 +00:00
(OSX) BasicOpenGLView - remove unneeded camera stuff
This commit is contained in:
parent
209b3c9919
commit
f359a633b6
@ -70,15 +70,6 @@ typedef struct {
|
||||
GLdouble x,y,z;
|
||||
} recVec;
|
||||
|
||||
typedef struct {
|
||||
recVec viewPos; // View position
|
||||
recVec viewDir; // View direction vector
|
||||
recVec viewUp; // View up direction
|
||||
recVec rotPoint; // Point to rotate about
|
||||
GLdouble aperture; // pContextInfo->camera aperture
|
||||
GLint viewWidth, viewHeight; // current window/screen height and width
|
||||
} recCamera;
|
||||
|
||||
@interface BasicOpenGLView : NSOpenGLView
|
||||
{
|
||||
// string attributes
|
||||
@ -101,9 +92,6 @@ typedef struct {
|
||||
bool fDrawHelp;
|
||||
|
||||
CFAbsoluteTime time;
|
||||
|
||||
// camera handling
|
||||
recCamera camera;
|
||||
GLfloat shapeSize;
|
||||
|
||||
}
|
||||
|
@ -145,17 +145,21 @@ GLenum glReportError (void)
|
||||
|
||||
// handles resizing of GL need context update and if the window dimensions change, a
|
||||
// a window dimension update, reseting of viewport and an update of the projection matrix
|
||||
|
||||
unsigned viewWidth = 0;
|
||||
unsigned viewHeight = 0;
|
||||
|
||||
- (void) resizeGL
|
||||
{
|
||||
NSRect rectView = [self bounds];
|
||||
|
||||
// ensure camera knows size changed
|
||||
if ((camera.viewHeight != rectView.size.height) ||
|
||||
(camera.viewWidth != rectView.size.width)) {
|
||||
camera.viewHeight = rectView.size.height;
|
||||
camera.viewWidth = rectView.size.width;
|
||||
if ((viewHeight != rectView.size.height) ||
|
||||
(viewWidth != rectView.size.width)) {
|
||||
viewHeight = rectView.size.height;
|
||||
viewWidth = rectView.size.width;
|
||||
|
||||
glViewport (0, 0, camera.viewWidth, camera.viewHeight);
|
||||
glViewport (0, 0, viewWidth, viewHeight);
|
||||
[[self openGLContext] makeCurrentContext];
|
||||
[self updateInfoString];
|
||||
}
|
||||
@ -163,25 +167,6 @@ GLenum glReportError (void)
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// sets the camera data to initial conditions
|
||||
- (void) resetCamera
|
||||
{
|
||||
camera.aperture = 40;
|
||||
|
||||
camera.viewPos.x = 0.0;
|
||||
camera.viewPos.y = 0.0;
|
||||
camera.viewPos.z = -10.0;
|
||||
camera.viewDir.x = -camera.viewPos.x;
|
||||
camera.viewDir.y = -camera.viewPos.y;
|
||||
camera.viewDir.z = -camera.viewPos.z;
|
||||
|
||||
camera.viewUp.x = 0;
|
||||
camera.viewUp.y = 1;
|
||||
camera.viewUp.z = 0;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// per-window timer function, basic time based animation preformed here
|
||||
- (void)animationTimer:(NSTimer *)timer
|
||||
{
|
||||
@ -247,8 +232,8 @@ GLenum glReportError (void)
|
||||
GLboolean depthTest = glIsEnabled (GL_DEPTH_TEST);
|
||||
GLfloat height, width, messageTop = 10.0f;
|
||||
|
||||
height = camera.viewHeight;
|
||||
width = camera.viewWidth;
|
||||
height = viewHeight;
|
||||
width = viewWidth;
|
||||
|
||||
// set orthograhic 1:1 pixel transform in local view coords
|
||||
glGetIntegerv (GL_MATRIX_MODE, &matrixMode);
|
||||
@ -426,7 +411,6 @@ GLenum glReportError (void)
|
||||
|
||||
[[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval]; // set to vbl sync
|
||||
|
||||
[self resetCamera];
|
||||
shapeSize = 7.0f; // max radius of of objects
|
||||
|
||||
// init fonts for use with strings
|
||||
|
Loading…
x
Reference in New Issue
Block a user