Blame |
Last modification |
View Log
| RSS feed
unit app_glscene_menu;
interface
uses OpenGL, GLaux, glExt, sux_constant, sux_object, app_constant,
resource_texture, resource_shader;
type
TSettings=record
logo:SRTexture;
end;
SAGLSMenu=class(SUXObject)
settings:TSettings;
procedure renderLogo;
procedure renderOptions;
procedure onTimer;
procedure initialize;
constructor Create(parent:TObject);
destructor Destroy; override;
end;
implementation
uses sux_main, gl_main, main;
// --- SAGLSMenu
procedure SAGLSMenu.renderLogo;
var density:SXFloat;
begin
density:=sx.math.random.getRandomFloat(0.7,1);
gl.gl2D.renderPatternQuad(settings.logo,SX_GL_BLEND_AVERAGE,sx.convert.ColorRGBOf(1,1,1),
density,0,0,1,1,320,240,200);
end;
procedure SAGLSMenu.renderOptions;
var top:SXFloat;
begin
top:=320;
app.scene.renderOutlineText(240,top,SX_GLFONT_ALIGN_LEFT,
1.5,'Start Game');
app.scene.renderOutlineText(240,top+25,SX_GLFONT_ALIGN_LEFT,
1.5,'High Score');
app.scene.renderOutlineText(240,top+50,SX_GLFONT_ALIGN_LEFT,
1.5,'Help!');
if (app.ini.settings.menu.canquit) then
begin
app.scene.renderOutlineText(240,top+75,SX_GLFONT_ALIGN_LEFT,
1.5,'Quit');
end;
app.scene.renderOutlineText(220,top+app.game.settings.menu.selection*25,SX_GLFONT_ALIGN_LEFT,
1.5,'>');
end;
procedure SAGLSMenu.onTimer;
begin
renderLogo;
renderOptions;
end;
procedure SAGLSMenu.initialize;
begin
settings.logo:=SRTexture.Create('textures\menu\logo',self);
end;
constructor SAGLSMenu.Create(parent:TObject);
begin
inherited Create(parent,'GL Menu');
end;
destructor SAGLSMenu.Destroy;
begin
settings.logo.Free;
inherited;
end;
end.