fixed setDepthBufferParams
This commit is contained in:
parent
2c2704badf
commit
d483237b66
@ -1,5 +1,5 @@
|
|||||||
Changelog for Photon
|
Changelog for Photon
|
||||||
$Id: CHANGELOG.txt,v 1.9 2005/08/16 06:32:39 cozman Exp $
|
$Id: CHANGELOG.txt,v 1.10 2005/08/17 03:15:23 cozman Exp $
|
||||||
|
|
||||||
! : Major Changes (potentially breaking existing code)
|
! : Major Changes (potentially breaking existing code)
|
||||||
+ : New Features
|
+ : New Features
|
||||||
@ -20,7 +20,7 @@ $Id: CHANGELOG.txt,v 1.9 2005/08/16 06:32:39 cozman Exp $
|
|||||||
time is calculated. (actual/average currently supported).
|
time is calculated. (actual/average currently supported).
|
||||||
+ Addition of fixed time stepping option in Application/State system.
|
+ Addition of fixed time stepping option in Application/State system.
|
||||||
+ Addition of code to allow control of depth testing via
|
+ Addition of code to allow control of depth testing via
|
||||||
Application::setDepthTestParams
|
Application::setDepthBufferParams
|
||||||
* Fixed X11 fullscreen mode
|
* Fixed X11 fullscreen mode
|
||||||
* Removed ALUT dependencies by adding custom WAV loading code
|
* Removed ALUT dependencies by adding custom WAV loading code
|
||||||
* Mouse move events now give relative position.
|
* Mouse move events now give relative position.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: Application.hpp,v 1.20 2005/08/16 06:32:39 cozman Exp $
|
// $Id: Application.hpp,v 1.21 2005/08/17 03:15:24 cozman Exp $
|
||||||
|
|
||||||
#ifndef PHOTON_APPLICATION_HPP
|
#ifndef PHOTON_APPLICATION_HPP
|
||||||
#define PHOTON_APPLICATION_HPP
|
#define PHOTON_APPLICATION_HPP
|
||||||
@ -231,13 +231,14 @@ public:
|
|||||||
// zFar - Distance from viewer to far clipping plane.
|
// zFar - Distance from viewer to far clipping plane.
|
||||||
void setPerspectiveProjection(scalar fovy, scalar zNear, scalar zFar);
|
void setPerspectiveProjection(scalar fovy, scalar zNear, scalar zFar);
|
||||||
|
|
||||||
// Function: setDepthTestMode
|
// Function: setDepthBufferParams
|
||||||
// Toggle depth testing and clearing of depth buffer.
|
// Toggle depth testing and clearing of depth buffer.
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// enable - if true, testing/clearing depth buffer is enabled, if false
|
// enable - if true, testing/clearing depth buffer is enabled, if false
|
||||||
// testing and clearing of depth buffer will be disabled.
|
// testing and clearing of depth buffer will be disabled.
|
||||||
void setDepthTestMode(bool enable);
|
// depth - optional clear depth amount, clamped [0..1], default is 1
|
||||||
|
void setDepthBufferParams(bool enable, scalar depth=1);
|
||||||
|
|
||||||
// Group: Input
|
// Group: Input
|
||||||
public:
|
public:
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: Application.cpp,v 1.25 2005/08/16 06:32:39 cozman Exp $
|
// $Id: Application.cpp,v 1.26 2005/08/17 03:15:23 cozman Exp $
|
||||||
|
|
||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
|
|
||||||
@ -186,7 +186,6 @@ void Application::createDisplay(uint width, uint height,
|
|||||||
|
|
||||||
initOpenGL();
|
initOpenGL();
|
||||||
setOrthoView();
|
setOrthoView();
|
||||||
setDepthTestMode(false);
|
|
||||||
|
|
||||||
// register the callbacks (after a window is open)
|
// register the callbacks (after a window is open)
|
||||||
glfwSetKeyCallback(Application::keyCallback);
|
glfwSetKeyCallback(Application::keyCallback);
|
||||||
@ -307,7 +306,7 @@ void Application::setOrthoProjection(scalar width, scalar height)
|
|||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
setDepthTestMode(true);
|
setDepthBufferParams(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setPerspectiveProjection(scalar fovy, scalar zNear,
|
void Application::setPerspectiveProjection(scalar fovy, scalar zNear,
|
||||||
@ -326,10 +325,11 @@ void Application::setPerspectiveProjection(scalar fovy, scalar zNear,
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setDepthTestMode(bool enable)
|
void Application::setDepthBufferParams(bool enable, scalar depth)
|
||||||
{
|
{
|
||||||
if(enable)
|
if(enable)
|
||||||
{
|
{
|
||||||
|
glClearDepth(depth);
|
||||||
glDepthFunc(GL_LEQUAL);
|
glDepthFunc(GL_LEQUAL);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
clearFlags_ |= GL_DEPTH_BUFFER_BIT;
|
clearFlags_ |= GL_DEPTH_BUFFER_BIT;
|
||||||
@ -592,7 +592,7 @@ void Application::initOpenGL()
|
|||||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
// depth testing enabled by default
|
// depth testing enabled by default
|
||||||
setDepthTestMode(false);
|
setDepthBufferParams(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user