Changed internal naming convention (local variables now start with a lower case character)
Removed the AudioResource class git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1166 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
7cc00085d8
commit
45b150648d
245 changed files with 7865 additions and 8065 deletions
|
@ -15,10 +15,10 @@
|
|||
int main()
|
||||
{
|
||||
// Create the main window
|
||||
sf::Window App(sf::VideoMode(640, 480, 32), "SFML Window");
|
||||
sf::Window window(sf::VideoMode(640, 480, 32), "SFML Window");
|
||||
|
||||
// Create a clock for measuring the time elapsed
|
||||
sf::Clock Clock;
|
||||
sf::Clock clock;
|
||||
|
||||
// Set the color and depth clear values
|
||||
glClearDepth(1.f);
|
||||
|
@ -34,29 +34,29 @@ int main()
|
|||
gluPerspective(90.f, 1.f, 1.f, 500.f);
|
||||
|
||||
// Start the game loop
|
||||
while (App.IsOpened())
|
||||
while (window.IsOpened())
|
||||
{
|
||||
// Process events
|
||||
sf::Event Event;
|
||||
while (App.GetEvent(Event))
|
||||
sf::Event event;
|
||||
while (window.GetEvent(event))
|
||||
{
|
||||
// Close window : exit
|
||||
if (Event.Type == sf::Event::Closed)
|
||||
App.Close();
|
||||
if (event.Type == sf::Event::Closed)
|
||||
window.Close();
|
||||
|
||||
// Escape key : exit
|
||||
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
|
||||
App.Close();
|
||||
if ((event.Type == sf::Event::KeyPressed) && (event.Key.Code == sf::Key::Escape))
|
||||
window.Close();
|
||||
|
||||
// Resize event : adjust viewport
|
||||
if (Event.Type == sf::Event::Resized)
|
||||
glViewport(0, 0, Event.Size.Width, Event.Size.Height);
|
||||
if (event.Type == sf::Event::Resized)
|
||||
glViewport(0, 0, event.Size.Width, event.Size.Height);
|
||||
}
|
||||
|
||||
// Set the active window before using OpenGL commands
|
||||
// It's useless here because the active window is always the same,
|
||||
// but don't forget it if you use multiple windows
|
||||
App.SetActive();
|
||||
window.SetActive();
|
||||
|
||||
// Clear color and depth buffer
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
@ -65,9 +65,9 @@ int main()
|
|||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.f, 0.f, -200.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 50, 1.f, 0.f, 0.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 30, 0.f, 1.f, 0.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 90, 0.f, 0.f, 1.f);
|
||||
glRotatef(clock.GetElapsedTime() * 50, 1.f, 0.f, 0.f);
|
||||
glRotatef(clock.GetElapsedTime() * 30, 0.f, 1.f, 0.f);
|
||||
glRotatef(clock.GetElapsedTime() * 90, 0.f, 0.f, 1.f);
|
||||
|
||||
// Draw a cube
|
||||
glBegin(GL_QUADS);
|
||||
|
@ -111,7 +111,7 @@ int main()
|
|||
glEnd();
|
||||
|
||||
// Finally, display the rendered frame on screen
|
||||
App.Display();
|
||||
window.Display();
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue