|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgraphics.Renderer
public class Renderer
The renderer class controls the flow of the rendering thread across methods and objects according to the selected game mode. The graphics that are not sepcific to game mode are implemented in the methods of this class, as well as sound effects and the general logic and state info for the flow of the graphical rendering.
Field Summary | |
---|---|
private float |
clockRot
|
private boolean |
countdownRendered
|
private int |
countdowntexture
|
(package private) TextureReader.Texture |
countdownTexture
|
private GameMode |
currentGameMode
|
(package private) boolean |
displayFirst
|
(package private) boolean |
displaySec
|
(package private) boolean |
displayThird
|
private GraphicsFacade |
facade
|
private boolean |
freshResults
|
private double |
gameAverage
|
private AudioSample |
gameOverSound
|
private boolean |
gameOverSoundPlayed
|
private javax.media.opengl.glu.GLU |
glu
|
private com.sun.opengl.util.j2d.TextRenderer |
hiResTextRenderer
|
(package private) TextureReader.Texture |
idleTexture
|
private boolean |
isLastQuestion
|
private boolean |
isLastRound
|
private com.sun.opengl.util.j2d.TextRenderer |
midResTextRenderer
|
private NumberFormat |
numberFormat
|
(package private) int |
printAverage
|
private boolean |
questionInitialized
|
private float |
rot
|
private boolean |
roundInitialized
|
private AudioSample |
secondSound
|
private long |
startTime
|
private QuestionGraphics |
tempQuestion
|
private Respondent[] |
tempRespondendts
|
private Respondent[] |
tempSumGameRespondents
|
private Respondent[] |
tempSumRespondents
|
private com.sun.opengl.util.j2d.TextRenderer |
textRenderer
|
private int |
texture
|
private int |
timeLimit
|
private long |
timemark
|
private AudioSample |
timesUpSound
|
Constructor Summary | |
---|---|
Renderer(GraphicsFacade facade)
initialize variables, sound clips. |
Method Summary | |
---|---|
void |
display(javax.media.opengl.GLAutoDrawable glDrawable)
This method is called for each frame to be displayed. |
void |
displayChanged(javax.media.opengl.GLAutoDrawable glDrawable,
boolean b,
boolean b1)
|
private int |
genTexture(javax.media.opengl.GL gl)
OpenGL helper methid for preaparation of textures. |
void |
init(javax.media.opengl.GLAutoDrawable glDrawable)
OpenGL specific einitializtion. |
void |
initializeLoginIdle(javax.media.opengl.GLAutoDrawable glDrawable)
|
boolean |
isQuestionInitialized()
|
private void |
makeRGBTexture(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
TextureReader.Texture img,
int target,
boolean mipmapped)
OpenGL helper methid for preaparation of textures. |
void |
nextStep()
Jumps to the next logical step as the user requests next step or the previous step was finished. |
boolean |
renderEndGame(javax.media.opengl.GLAutoDrawable glDrawable)
Render the high score list to screen |
(package private) void |
renderLoginIdle(javax.media.opengl.GLAutoDrawable glDrawable)
|
void |
renderPopQuestion(javax.media.opengl.GLAutoDrawable glDrawable)
Render the posing of the question, with alternatives and the animated timer. |
void |
reshape(javax.media.opengl.GLAutoDrawable glDrawable,
int x,
int y,
int w,
int h)
OpenGL specific reshaping. |
void |
returnGameResults(Respondent[] respondents)
|
void |
returnResults(QuestionGraphics question,
Respondent[] respondents)
|
void |
returnRoundResults(Respondent[] respondents)
|
void |
setLastQuestion(boolean isLastQuestion)
|
void |
setLastRound(boolean b)
|
void |
setMode(int mode)
A call to this method sets the current game mode to the selectid integer. |
void |
setQuestionInitialized(boolean questionInitialized)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.media.opengl.glu.GLU glu
private NumberFormat numberFormat
private com.sun.opengl.util.j2d.TextRenderer textRenderer
private com.sun.opengl.util.j2d.TextRenderer hiResTextRenderer
private com.sun.opengl.util.j2d.TextRenderer midResTextRenderer
private QuestionGraphics tempQuestion
private GraphicsFacade facade
private int texture
private int countdowntexture
private boolean countdownRendered
private float rot
private long startTime
private float clockRot
private long timemark
private int timeLimit
private boolean questionInitialized
private boolean roundInitialized
private AudioSample secondSound
private AudioSample timesUpSound
private boolean isLastQuestion
boolean displayFirst
boolean displaySec
boolean displayThird
int printAverage
TextureReader.Texture idleTexture
TextureReader.Texture countdownTexture
private GameMode currentGameMode
private boolean freshResults
private Respondent[] tempRespondendts
private Respondent[] tempSumRespondents
private boolean isLastRound
private Respondent[] tempSumGameRespondents
private double gameAverage
private AudioSample gameOverSound
private boolean gameOverSoundPlayed
Constructor Detail |
---|
public Renderer(GraphicsFacade facade)
facade
- Method Detail |
---|
public void initializeLoginIdle(javax.media.opengl.GLAutoDrawable glDrawable)
void renderLoginIdle(javax.media.opengl.GLAutoDrawable glDrawable)
public boolean renderEndGame(javax.media.opengl.GLAutoDrawable glDrawable)
glDrawable
-
public void renderPopQuestion(javax.media.opengl.GLAutoDrawable glDrawable)
glDrawable
- public void init(javax.media.opengl.GLAutoDrawable glDrawable)
init
in interface javax.media.opengl.GLEventListener
public void display(javax.media.opengl.GLAutoDrawable glDrawable)
display
in interface javax.media.opengl.GLEventListener
public void reshape(javax.media.opengl.GLAutoDrawable glDrawable, int x, int y, int w, int h)
reshape
in interface javax.media.opengl.GLEventListener
public void displayChanged(javax.media.opengl.GLAutoDrawable glDrawable, boolean b, boolean b1)
displayChanged
in interface javax.media.opengl.GLEventListener
public void nextStep()
private void makeRGBTexture(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, TextureReader.Texture img, int target, boolean mipmapped)
gl
- glu
- img
- target
- mipmapped
- private int genTexture(javax.media.opengl.GL gl)
gl
-
public void setMode(int mode)
mode
- public boolean isQuestionInitialized()
public void setQuestionInitialized(boolean questionInitialized)
public void returnResults(QuestionGraphics question, Respondent[] respondents)
public void setLastQuestion(boolean isLastQuestion)
public void setLastRound(boolean b)
public void returnRoundResults(Respondent[] respondents)
public void returnGameResults(Respondent[] respondents)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |