1
Window / Text input
« on: March 05, 2010, 04:45:13 pm »
Thanks! Got it working now
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#include "stdafx.h"
#include <SFML/Window.hpp>
int main()
{
// Create the main window
sf::Window App(sf::VideoMode(800, 600, 16), "SFML Events");
// Get a reference to the input manager associated to our window, and store it for later use
const sf::Input& Input = App.GetInput();
// Start main loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
// Escape key : exit
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}
// Get some useless input states, just to illustrate the tutorial
bool LeftKeyDown = Input.IsKeyDown(sf::Key::Left);
bool RightButtonDown = Input.IsMouseButtonDown(sf::Mouse::Right);
bool JoyButton1Down = Input.IsJoystickButtonDown(0, 1);
unsigned int MouseX = Input.GetMouseX();
unsigned int MouseY = Input.GetMouseY();
// Display window on screen
App.Display();
}
return EXIT_SUCCESS;
}
'regf.exe': Loaded 'C:\Documents and Settings\Sonya G. Aguilar\My Documents\Visual Studio 2008\Projects\regf\Debug\regf.exe', Symbols loaded.
'regf.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\EntAPI.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\user32.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\psapi.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\netapi32.dll'
'regf.exe': Loaded 'C:\WINDOWS\system32\imm32.dll'
'regf.exe': Unloaded 'C:\WINDOWS\system32\EntAPI.dll'
'regf.exe': Unloaded 'C:\WINDOWS\system32\netapi32.dll'
'regf.exe': Unloaded 'C:\WINDOWS\system32\psapi.dll'
'regf.exe': Unloaded 'C:\WINDOWS\system32\msvcrt.dll'
Debugger:: An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load
The program '[2820] regf.exe: Native' has exited with code -1073741515 (0xc0000135).
#include "stdafx.h"
#include <SFML/System.hpp>
#include <iostream>
int main()
{
sf::Clock Clock;
while (Clock.GetElapsedTime() < 5.f)
{
std::cout << Clock.GetElapsedTime() << std::endl;
sf::Sleep(0.5f);
}
return 0;
}