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
|
@ -20,8 +20,8 @@ public :
|
|||
/// Construct the canvas
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
MyCanvas(QWidget* Parent = NULL) :
|
||||
QSFMLCanvas(QSize(100, 100), 0, Parent)
|
||||
MyCanvas(QWidget* parent = NULL) :
|
||||
QSFMLCanvas(QSize(100, 100), 0, parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -48,19 +48,19 @@ private :
|
|||
////////////////////////////////////////////////////////////
|
||||
virtual void OnUpdate()
|
||||
{
|
||||
sf::Event Event;
|
||||
while (GetEvent(Event))
|
||||
sf::Event event;
|
||||
while (GetEvent(event))
|
||||
{
|
||||
// Stick the sprite to the mouse cursor
|
||||
if (Event.Type == sf::Event::MouseMoved)
|
||||
if (event.Type == sf::Event::MouseMoved)
|
||||
{
|
||||
mySprite.SetPosition(ConvertCoords(Event.MouseMove.X, Event.MouseMove.Y));
|
||||
mySprite.SetPosition(ConvertCoords(event.MouseMove.X, event.MouseMove.Y));
|
||||
}
|
||||
|
||||
// Adjust the size of the default view when the widget is resized
|
||||
if (Event.Type == sf::Event::Resized)
|
||||
if (event.Type == sf::Event::Resized)
|
||||
{
|
||||
GetDefaultView().Reset(sf::FloatRect(0, 0, Event.Size.Width, Event.Size.Height));
|
||||
GetDefaultView().Reset(sf::FloatRect(0, 0, event.Size.Width, event.Size.Height));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,26 +90,26 @@ private :
|
|||
////////////////////////////////////////////////////////////
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication App(argc, argv);
|
||||
QApplication application(argc, argv);
|
||||
|
||||
// Create the main frame
|
||||
QFrame* MainFrame = new QFrame;
|
||||
MainFrame->setWindowTitle("Qt SFML");
|
||||
MainFrame->resize(400, 400);
|
||||
MainFrame->show();
|
||||
QFrame* mainFrame = new QFrame;
|
||||
mainFrame->setWindowTitle("Qt SFML");
|
||||
mainFrame->resize(400, 400);
|
||||
mainFrame->show();
|
||||
|
||||
// Create a label for showing some text
|
||||
QLabel* Label = new QLabel("This is a SFML window\nembedded into a Qt frame :", MainFrame);
|
||||
Label->setFont(QFont("courier new", 14, 1, false));
|
||||
QLabel* label = new QLabel("This is a SFML window\nembedded into a Qt frame :", mainFrame);
|
||||
label->setFont(QFont("courier new", 14, 1, false));
|
||||
|
||||
// Create a SFML view inside the main frame
|
||||
MyCanvas* SFMLView = new MyCanvas(MainFrame);
|
||||
MyCanvas* SFMLView = new MyCanvas(mainFrame);
|
||||
|
||||
// Create the main layout
|
||||
QVBoxLayout* Layout = new QVBoxLayout;
|
||||
Layout->addWidget(Label, 0);
|
||||
Layout->addWidget(SFMLView, 1);
|
||||
MainFrame->setLayout(Layout);
|
||||
QVBoxLayout* layout = new QVBoxLayout;
|
||||
layout->addWidget(label, 0);
|
||||
layout->addWidget(SFMLView, 1);
|
||||
mainFrame->setLayout(layout);
|
||||
|
||||
return App.exec();
|
||||
return application.exec();
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Construct the QSFMLCanvas
|
||||
////////////////////////////////////////////////////////////
|
||||
QSFMLCanvas::QSFMLCanvas(const QSize& Size, unsigned int FrameTime, QWidget* Parent) :
|
||||
QWidget(Parent)
|
||||
QSFMLCanvas::QSFMLCanvas(const QSize& size, unsigned int frameTime, QWidget* parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
// Resize the widget
|
||||
resize(Size);
|
||||
resize(size);
|
||||
|
||||
// Setup some states to allow direct rendering into the widget
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
|
@ -30,7 +30,7 @@ QWidget(Parent)
|
|||
setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
// Setup the timer
|
||||
myTimer.setInterval(FrameTime);
|
||||
myTimer.setInterval(frameTime);
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,9 +77,9 @@ QPaintEngine* QSFMLCanvas::paintEngine() const
|
|||
/// we use it to catch the Polish event and initialize
|
||||
/// our SFML window
|
||||
////////////////////////////////////////////////////////////
|
||||
bool QSFMLCanvas::event(QEvent* Event)
|
||||
bool QSFMLCanvas::event(QEvent* event)
|
||||
{
|
||||
if (Event->type() == QEvent::Polish)
|
||||
if (event->type() == QEvent::Polish)
|
||||
{
|
||||
// Under X11, we need to flush the commands sent to the server to ensure that
|
||||
// SFML will get an updated view of the windows
|
||||
|
@ -98,7 +98,7 @@ bool QSFMLCanvas::event(QEvent* Event)
|
|||
myTimer.start();
|
||||
}
|
||||
|
||||
return QWidget::event(Event);
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ public :
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Construct the QSFMLCanvas
|
||||
///
|
||||
/// \param Size : Initial size of the widget
|
||||
/// \param FrameTime : Frame duration, in milliseconds (0 by default)
|
||||
/// \param Parent : Parent of the widget (NULL by default)
|
||||
/// \param size : Initial size of the widget
|
||||
/// \param frameTime : Frame duration, in milliseconds (0 by default)
|
||||
/// \param parent : Parent of the widget (NULL by default)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
QSFMLCanvas(const QSize& Size, unsigned int FrameTime = 0, QWidget* Parent = NULL);
|
||||
QSFMLCanvas(const QSize& size, unsigned int frameTime = 0, QWidget* parent = NULL);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Destructor
|
||||
|
@ -62,8 +62,10 @@ private :
|
|||
/// we use it to catch the Polish event and initialize
|
||||
/// our SFML window
|
||||
///
|
||||
/// \param event : Event's attributes
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual bool event(QEvent* Event);
|
||||
virtual bool event(QEvent* event);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the widget needs to be painted ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue