remove Flip mode
This commit is contained in:
parent
afd1d1a7b8
commit
ee2a618de8
@ -1,64 +0,0 @@
|
|||||||
|
|
||||||
#include <GL/gl.h>
|
|
||||||
#include <GL/glu.h>
|
|
||||||
|
|
||||||
#include "Flip.h"
|
|
||||||
|
|
||||||
#define FLIP_TICKS 1000
|
|
||||||
#define STATIC_TICKS 200
|
|
||||||
#define SPAN_Y 5
|
|
||||||
|
|
||||||
Flip::Flip()
|
|
||||||
{
|
|
||||||
m_state = WAITING;
|
|
||||||
m_span_x = 6;
|
|
||||||
m_span_y = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Flip::expose (GnomeScreensaver & gs)
|
|
||||||
{
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
|
|
||||||
glTranslatef(m_x, m_y, 0.0);
|
|
||||||
m_logobox.draw();
|
|
||||||
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Flip::configure (GnomeScreensaver & gs)
|
|
||||||
{
|
|
||||||
glViewport(0, 0, gs.getWidth(), gs.getHeight());
|
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glLoadIdentity();
|
|
||||||
gluPerspective(60.0, gs.getAspectRatio(), 0.01, 1000.0);
|
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glLoadIdentity();
|
|
||||||
gluLookAt(0, 0, SPAN_Y * m_logobox.getDepth(), 0, 0, 0, 0, 1, 0);
|
|
||||||
|
|
||||||
m_span_x = (int) (m_span_y * gs.getAspectRatio()
|
|
||||||
/ (m_logobox.getWidth() / m_logobox.getDepth()) + 0.5);
|
|
||||||
m_y = 0.0f;
|
|
||||||
m_x = -(1 - (m_span_x & 0x1)) * m_logobox.getWidth() / 2.0;
|
|
||||||
m_last_ticks = gs.getTicks();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Flip::update (GnomeScreensaver & gs)
|
|
||||||
{
|
|
||||||
switch (m_state)
|
|
||||||
{
|
|
||||||
case WAITING:
|
|
||||||
break;
|
|
||||||
case FLIPPING:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
31
modes/Flip.h
31
modes/Flip.h
@ -1,31 +0,0 @@
|
|||||||
|
|
||||||
#ifndef FLIP_H
|
|
||||||
#define FLIP_H
|
|
||||||
|
|
||||||
#include "LogoBox.h"
|
|
||||||
#include "Mode.h"
|
|
||||||
#include "GnomeScreensaver.h"
|
|
||||||
|
|
||||||
class Flip : public Mode
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
WAITING,
|
|
||||||
FLIPPING
|
|
||||||
} State;
|
|
||||||
Flip();
|
|
||||||
bool expose (GnomeScreensaver & gs);
|
|
||||||
bool configure (GnomeScreensaver & gs);
|
|
||||||
bool update (GnomeScreensaver & gs);
|
|
||||||
protected:
|
|
||||||
LogoBox m_logobox;
|
|
||||||
State m_state;
|
|
||||||
int m_span_x, m_span_y;
|
|
||||||
float m_x, m_y;
|
|
||||||
int m_flip_direction;
|
|
||||||
int m_last_ticks;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* FLIP_H */
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user