Jump to content

  • Log In with Google      Sign In   
  • Create Account


QT SFML C++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
27 replies to this topic

#21 Saint Squireen   Members   -  Reputation: 181

Like
0Likes
Like

Posted 20 July 2012 - 07:14 PM

Wierd........ It didnt fix it........I extracted the files, erased the second target, and changed the include path problem but nothing seemed to be fixed........ It came up with the same error too. The "multiple target patterns. stop. /newline/ File not found: Makefile.Debug" error.... Is there any way to just send you my project and see whats messed up about it? Would that make it help?

~Saint Squireen

Sponsor:

#22 Saint Squireen   Members   -  Reputation: 181

Like
0Likes
Like

Posted 20 July 2012 - 07:15 PM

#-------------------------------------------------
#
# Project created by QtCreator 2012-07-20T14:57:41
#
#-------------------------------------------------
QT += core gui
TARGET = SFML-Test
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
QSFMLCanvas.cpp
HEADERS += mainwindow.h \
QSFMLCanvas.hpp
FORMS += mainwindow.ui
#Location to save your executable:
DESTDIR = "C:\Users\Griffin Laptop\Desktop\SFML-1.6-sdk-windows-mingw"
#SFML libraries:
LIBS += -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system -lsfml-main
#Path to the linker import files: (sfml-audio.a or whatever)
LIBS += -L"C:\Users\Griffin Laptop\Desktop\SFML-1.6-sdk-windows-mingw\SFML-1.6\lib"
#Path to SFML headers:
INCLUDEPATH = "C:\Users\Griffin Laptop\Desktop\SFML-1.6-sdk-windows-mingw\SFML-1.6\include"






Heres what I have again.

~Saint Squireen

#23 Servant of the Lord   Crossbones+   -  Reputation: 18203

Like
0Likes
Like

Posted 20 July 2012 - 07:28 PM

I just left my development machine, so if you post your source files and header file (post them between [ code ] and [ /code ] tags, like this:

MyHeaderName.h
[ code ] my code goes here [ /code ] //But without spaces between the square brackets.

MySourceName.h
[ code ] my code goes here [ /code ]

MyOtherHeader.h
[ code ] my code goes here [ /code ]

Because I'm no longer on my programming machine, and am just using a laptop somewhere else, I can't test your project at the moment, but I will do so tomorrow morning unless you or someone else figures it out before then.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.

[Fly with me on Twitter] [Google+] [My broken website]

All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.                                                                                                                                                            [Need web hosting? I personally like A Small Orange]
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal


#24 Saint Squireen   Members   -  Reputation: 181

Like
0Likes
Like

Posted 21 July 2012 - 09:10 AM

okay I understand 1 second................

~Saint Squireen

#25 Saint Squireen   Members   -  Reputation: 181

Like
0Likes
Like

Posted 21 July 2012 - 09:30 AM

main.cpp
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Headers[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]"QSFMLCanvas.hpp"[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QApplication>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QVBoxLayout>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QFrame>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QLabel>[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Custom[/color][color=#c0c0c0] [/color][color=#000080]SFML[/color][color=#c0c0c0] [/color][color=#000080]canvas[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]class[/color][color=#c0c0c0] [/color][color=#800080]MyCanvas[/color][color=#c0c0c0] [/color][color=#000000]:[/color][color=#c0c0c0] [/color][color=#808000]public[/color][color=#c0c0c0] [/color]QSFMLCanvas
[color=#000000]{[/color]
[color=#808000]public[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Construct[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]canvas[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#800080]MyCanvas[/color][color=#000000]([/color]QWidget[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Parent[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color]NULL[color=#000000])[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0]    [/color]QSFMLCanvas[color=#000000]([/color]QSize[color=#000000]([/color][color=#000080]100[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]100[/color][color=#000000]),[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]Parent[/color][color=#000000])[/color]
[color=#c0c0c0]    [/color][color=#000000]{[/color]
[color=#c0c0c0]    [/color][color=#000000]}[/color]
[color=#808000]private[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]/see[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas::OnInit[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]OnInit[/i][/color][color=#000000]()[/color]
[color=#c0c0c0]    [/color][color=#000000]{[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Load[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]image[/color]
[color=#c0c0c0]        [/color][color=#800000]myImage[/color][color=#000000].[/color]LoadFromFile[color=#000000]([/color][color=#008000]"datas/qt/sfml.png"[/color][color=#000000]);[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Setup[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]sprite[/color]
[color=#c0c0c0]        [/color][color=#800000]mySprite[/color][color=#000000].[/color]SetImage[color=#000000]([/color][color=#800000]myImage[/color][color=#000000]);[/color]
[color=#c0c0c0]        [/color][color=#800000]mySprite[/color][color=#000000].[/color]SetCenter[color=#000000]([/color][color=#800000]mySprite[/color][color=#000000].[/color]GetSize[color=#000000]()[/color][color=#c0c0c0] [/color][color=#000000]/[/color][color=#c0c0c0] [/color][color=#000080]2.f[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#000000]}[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]/see[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas::OnUpdate[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]OnUpdate[/i][/color][color=#000000]()[/color]
[color=#c0c0c0]    [/color][color=#000000]{[/color]
[color=#c0c0c0]        [/color]sf[color=#000000]::[/color]Event[color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000];[/color]
[color=#c0c0c0]        [/color][color=#808000]while[/color][color=#c0c0c0] [/color][color=#000000]([/color]GetEvent[color=#000000]([/color][color=#000000]Event[/color][color=#000000]))[/color]
[color=#c0c0c0]        [/color][color=#000000]{[/color]
[color=#c0c0c0]            [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Stick[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]sprite[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]mouse[/color][color=#c0c0c0] [/color][color=#008000]cursor[/color]
[color=#c0c0c0]            [/color][color=#808000]if[/color][color=#c0c0c0] [/color][color=#000000]([/color][color=#000000]Event[/color][color=#000000].[/color]Type[color=#c0c0c0] [/color][color=#000000]==[/color][color=#c0c0c0] [/color]sf[color=#000000]::[/color]Event[color=#000000]::[/color]MouseMoved[color=#000000])[/color]
[color=#c0c0c0]            [/color][color=#000000]{[/color]
[color=#c0c0c0]                [/color][color=#800000]mySprite[/color][color=#000000].[/color]SetPosition[color=#000000]([/color]ConvertCoords[color=#000000]([/color][color=#000000]Event[/color][color=#000000].[/color]MouseMove[color=#000000].[/color]X[color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000].[/color]MouseMove[color=#000000].[/color]Y[color=#000000]));[/color]
[color=#c0c0c0]            [/color][color=#000000]}[/color]
[color=#c0c0c0]            [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Adjust[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]size[/color][color=#c0c0c0] [/color][color=#008000]of[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]default[/color][color=#c0c0c0] [/color][color=#008000]view[/color][color=#c0c0c0] [/color][color=#008000]when[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]widget[/color][color=#c0c0c0] [/color][color=#008000]is[/color][color=#c0c0c0] [/color][color=#008000]resized[/color]
[color=#c0c0c0]            [/color][color=#808000]if[/color][color=#c0c0c0] [/color][color=#000000]([/color][color=#000000]Event[/color][color=#000000].[/color]Type[color=#c0c0c0] [/color][color=#000000]==[/color][color=#c0c0c0] [/color]sf[color=#000000]::[/color]Event[color=#000000]::[/color]Resized[color=#000000])[/color]
[color=#c0c0c0]            [/color][color=#000000]{[/color]
[color=#c0c0c0]                [/color]GetDefaultView[color=#000000]().[/color]SetFromRect[color=#000000]([/color]sf[color=#000000]::[/color]FloatRect[color=#000000]([/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000].[/color]Size[color=#000000].[/color]Width[color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000].[/color]Size[color=#000000].[/color]Height[color=#000000]));[/color]
[color=#c0c0c0]            [/color][color=#000000]}[/color]
[color=#c0c0c0]        [/color][color=#000000]}[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Rotate[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]sprite[/color]
[color=#c0c0c0]        [/color][color=#800000]mySprite[/color][color=#000000].[/color]Rotate[color=#000000]([/color]GetFrameTime[color=#000000]()[/color][color=#c0c0c0] [/color][color=#000000]*[/color][color=#c0c0c0] [/color][color=#000080]100.f[/color][color=#000000]);[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Clear[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]view[/color]
[color=#c0c0c0]        [/color]Clear[color=#000000]([/color]sf[color=#000000]::[/color]Color[color=#000000]([/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]128[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000]));[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Draw[/color][color=#c0c0c0] [/color][color=#008000]it[/color]
[color=#c0c0c0]        [/color]Draw[color=#000000]([/color][color=#800000]mySprite[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#000000]}[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Member[/color][color=#c0c0c0] [/color][color=#000080]data[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color]sf[color=#000000]::[/color]Image[color=#c0c0c0]  [/color][color=#800000]myImage[/color][color=#000000];[/color][color=#c0c0c0]  [/color][color=#000080]///<[/color][color=#c0c0c0] [/color][color=#000080]Some[/color][color=#c0c0c0] [/color][color=#000080]image[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]show[/color]
[color=#c0c0c0]    [/color]sf[color=#000000]::[/color]Sprite[color=#c0c0c0] [/color][color=#800000]mySprite[/color][color=#000000];[/color][color=#c0c0c0] [/color][color=#000080]///<[/color][color=#c0c0c0] [/color][color=#000080]A[/color][color=#c0c0c0] [/color][color=#000080]sprite[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]display[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]image[/color]
[color=#000000]};[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Entry[/color][color=#c0c0c0] [/color][color=#000080]point[/color][color=#c0c0c0] [/color][color=#000080]of[/color][color=#c0c0c0] [/color][color=#000080]application[/color]
[color=#008000]///[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#0000ff]\return[/color][color=#c0c0c0] [/color][color=#000080]Application[/color][color=#c0c0c0] [/color][color=#000080]exit[/color][color=#c0c0c0] [/color][color=#000080]code[/color]
[color=#008000]///[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]int[/color][color=#c0c0c0] [/color]main[color=#000000]([/color][color=#808000]int[/color][color=#c0c0c0] [/color][color=#000000]argc[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]char[/color][color=#c0c0c0] [/color][color=#000000]**[/color][color=#000000]argv[/color][color=#000000])[/color]
[color=#000000]{[/color]
[color=#c0c0c0]    [/color]QApplication[color=#c0c0c0] [/color][color=#000000]App[/color][color=#000000]([/color][color=#000000]argc[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]argv[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]main[/color][color=#c0c0c0] [/color][color=#008000]frame[/color]
[color=#c0c0c0]    [/color]QFrame[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]MainFrame[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#808000]new[/color][color=#c0c0c0] [/color]QFrame[color=#000000];[/color]
[color=#c0c0c0]    [/color][color=#000000]MainFrame[/color][color=#000000]->[/color]setWindowTitle[color=#000000]([/color][color=#008000]"Qt[/color][color=#c0c0c0] [/color][color=#008000]SFML"[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#000000]MainFrame[/color][color=#000000]->[/color]resize[color=#000000]([/color][color=#000080]400[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]400[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#000000]MainFrame[/color][color=#000000]->[/color]show[color=#000000]();[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]label[/color][color=#c0c0c0] [/color][color=#008000]for[/color][color=#c0c0c0] [/color][color=#008000]showing[/color][color=#c0c0c0] [/color][color=#008000]some[/color][color=#c0c0c0] [/color][color=#008000]text[/color]
[color=#c0c0c0]    [/color]QLabel[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Label[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#808000]new[/color][color=#c0c0c0] [/color]QLabel[color=#000000]([/color][color=#008000]"This[/color][color=#c0c0c0] [/color][color=#008000]is[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]window\nembedded[/color][color=#c0c0c0] [/color][color=#008000]into[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]Qt[/color][color=#c0c0c0] [/color][color=#008000]frame[/color][color=#c0c0c0] [/color][color=#008000]:"[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]MainFrame[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#000000]Label[/color][color=#000000]->[/color]setFont[color=#000000]([/color]QFont[color=#000000]([/color][color=#008000]"courier[/color][color=#c0c0c0] [/color][color=#008000]new"[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]14[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]1[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]false[/color][color=#000000]));[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]view[/color][color=#c0c0c0] [/color][color=#008000]inside[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]main[/color][color=#c0c0c0] [/color][color=#008000]frame[/color]
[color=#c0c0c0]    [/color][color=#800080]MyCanvas[/color][color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]SFMLView[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#808000]new[/color][color=#c0c0c0] [/color][color=#800080]MyCanvas[/color][color=#000000]([/color][color=#000000]MainFrame[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]main[/color][color=#c0c0c0] [/color][color=#008000]layout[/color]
[color=#c0c0c0]    [/color]QVBoxLayout[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Layout[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#808000]new[/color][color=#c0c0c0] [/color]QVBoxLayout[color=#000000];[/color]
[color=#c0c0c0]    [/color][color=#000000]Layout[/color][color=#000000]->[/color]addWidget[color=#000000]([/color][color=#000000]Label[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#000000]Layout[/color][color=#000000]->[/color]addWidget[color=#000000]([/color][color=#000000]SFMLView[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]1[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#000000]MainFrame[/color][color=#000000]->[/color]setLayout[color=#000000]([/color][color=#000000]Layout[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#808000]return[/color][color=#c0c0c0] [/color][color=#000000]App[/color][color=#000000].[/color]exec[color=#000000]();[/color]
[color=#000000]}[/color]


QSFMLCanvas.cpp
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Headers[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]"QSFMLCanvas.hpp"[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QEvent>[/color]
[color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Platform-specific[/color][color=#c0c0c0] [/color][color=#008000]headers[/color]
[color=#000080]#ifdef[/color][color=#c0c0c0] [/color]Q_WS_X11
[color=#c0c0c0]    [/color][color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<Qt/qx11info_x11.h>[/color]
[color=#c0c0c0]    [/color][color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<X11/Xlib.h>[/color]
[color=#000080]#endif[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Construct[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
QSFMLCanvas[color=#000000]::[/color]QSFMLCanvas[color=#000000]([/color][color=#808000]const[/color][color=#c0c0c0] [/color]QSize[color=#000000]&[/color][color=#c0c0c0] [/color][color=#000000]Size[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]unsigned[/color][color=#c0c0c0] [/color][color=#808000]int[/color][color=#c0c0c0] [/color][color=#000000]FrameTime[/color][color=#000000],[/color][color=#c0c0c0] [/color]QWidget[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Parent[/color][color=#000000])[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
QWidget[color=#000000]([/color][color=#000000]Parent[/color][color=#000000])[/color]
[color=#000000]{[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Resize[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]widget[/color]
[color=#c0c0c0]    [/color]resize[color=#000000]([/color][color=#000000]Size[/color][color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Setup[/color][color=#c0c0c0] [/color][color=#008000]some[/color][color=#c0c0c0] [/color][color=#008000]states[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]allow[/color][color=#c0c0c0] [/color][color=#008000]direct[/color][color=#c0c0c0] [/color][color=#008000]rendering[/color][color=#c0c0c0] [/color][color=#008000]into[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]widget[/color]
[color=#c0c0c0]    [/color]setAttribute[color=#000000]([/color]Qt[color=#000000]::[/color]WA_PaintOnScreen[color=#000000]);[/color]
[color=#c0c0c0]    [/color]setAttribute[color=#000000]([/color]Qt[color=#000000]::[/color]WA_OpaquePaintEvent[color=#000000]);[/color]
[color=#c0c0c0]    [/color]setAttribute[color=#000000]([/color]Qt[color=#000000]::[/color]WA_NoSystemBackground[color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Set[/color][color=#c0c0c0] [/color][color=#008000]strong[/color][color=#c0c0c0] [/color][color=#008000]focus[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]enable[/color][color=#c0c0c0] [/color][color=#008000]keyboard[/color][color=#c0c0c0] [/color][color=#008000]events[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]be[/color][color=#c0c0c0] [/color][color=#008000]received[/color]
[color=#c0c0c0]    [/color]setFocusPolicy[color=#000000]([/color]Qt[color=#000000]::[/color]StrongFocus[color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Setup[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]timer[/color]
[color=#c0c0c0]    [/color]myTimer[color=#000000].[/color]setInterval[color=#000000]([/color][color=#000000]FrameTime[/color][color=#000000]);[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Destructor[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
QSFMLCanvas[color=#000000]::~[/color]QSFMLCanvas[color=#000000]()[/color]
[color=#000000]{[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Nothing[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]do...[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Notification[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]derived[/color][color=#c0c0c0] [/color][color=#000080]class[/color][color=#c0c0c0] [/color][color=#000080]that[/color][color=#c0c0c0] [/color][color=#000080]moment[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]good[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]doing[/color][color=#c0c0c0] [/color][color=#000080]initializations[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]void[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]OnInit[color=#000000]()[/color]
[color=#000000]{[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Nothing[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]do[/color][color=#c0c0c0] [/color][color=#008000]by[/color][color=#c0c0c0] [/color][color=#008000]default...[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Notification[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]derived[/color][color=#c0c0c0] [/color][color=#000080]class[/color][color=#c0c0c0] [/color][color=#000080]that[/color][color=#c0c0c0] [/color][color=#000080]moment[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]good[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]doing[/color][color=#c0c0c0] [/color][color=#000080]its[/color][color=#c0c0c0] [/color][color=#000080]update[/color][color=#c0c0c0] [/color][color=#000080]and[/color][color=#c0c0c0] [/color][color=#000080]drawing[/color][color=#c0c0c0] [/color][color=#000080]stuff[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]void[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]OnUpdate[color=#000000]()[/color]
[color=#000000]{[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Nothing[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]do[/color][color=#c0c0c0] [/color][color=#008000]by[/color][color=#c0c0c0] [/color][color=#008000]default...[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Return[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]paint[/color][color=#c0c0c0] [/color][color=#000080]engine[/color][color=#c0c0c0] [/color][color=#000080]used[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]draw[/color][color=#c0c0c0] [/color][color=#000080]itself[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
QPaintEngine[color=#000000]*[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]paintEngine[color=#000000]()[/color][color=#c0c0c0] [/color][color=#808000]const[/color]
[color=#000000]{[/color]
[color=#c0c0c0]    [/color][color=#808000]return[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000];[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Called[/color][color=#c0c0c0] [/color][color=#000080]each[/color][color=#c0c0c0] [/color][color=#000080]time[/color][color=#c0c0c0] [/color][color=#000080]an[/color][color=#c0c0c0] [/color][color=#000080]event[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]received[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080];[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]we[/color][color=#c0c0c0] [/color][color=#000080]use[/color][color=#c0c0c0] [/color][color=#000080]it[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]catch[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]Polish[/color][color=#c0c0c0] [/color][color=#000080]event[/color][color=#c0c0c0] [/color][color=#000080]and[/color][color=#c0c0c0] [/color][color=#000080]initialize[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]our[/color][color=#c0c0c0] [/color][color=#000080]SFML[/color][color=#c0c0c0] [/color][color=#000080]window[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]bool[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]event[color=#000000]([/color]QEvent[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000])[/color]
[color=#000000]{[/color]
[color=#c0c0c0]    [/color][color=#808000]if[/color][color=#c0c0c0] [/color][color=#000000]([/color][color=#000000]Event[/color][color=#000000]->[/color]type[color=#000000]()[/color][color=#c0c0c0] [/color][color=#000000]==[/color][color=#c0c0c0] [/color]QEvent[color=#000000]::[/color]Polish[color=#000000])[/color]
[color=#c0c0c0]    [/color][color=#000000]{[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Under[/color][color=#c0c0c0] [/color][color=#008000]X11,[/color][color=#c0c0c0] [/color][color=#008000]we[/color][color=#c0c0c0] [/color][color=#008000]need[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]flush[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]commands[/color][color=#c0c0c0] [/color][color=#008000]sent[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]server[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]ensure[/color][color=#c0c0c0] [/color][color=#008000]that[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]will[/color][color=#c0c0c0] [/color][color=#008000]get[/color][color=#c0c0c0] [/color][color=#008000]an[/color][color=#c0c0c0] [/color][color=#008000]updated[/color][color=#c0c0c0] [/color][color=#008000]view[/color][color=#c0c0c0] [/color][color=#008000]of[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]windows[/color]
[color=#c0c0c0]        [/color][color=#000080]#ifdef[/color][color=#c0c0c0] [/color]Q_WS_X11
[color=#c0c0c0]            [/color]XFlush[color=#000000]([/color]QX11Info[color=#000000]::[/color]display[color=#000000]());[/color]
[color=#c0c0c0]        [/color][color=#000080]#endif[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]window[/color][color=#c0c0c0] [/color][color=#008000]with[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]widget[/color][color=#c0c0c0] [/color][color=#008000]handle[/color]
[color=#c0c0c0]        [/color]Create[color=#000000]([/color]winId[color=#000000]());[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Let[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]derived[/color][color=#c0c0c0] [/color][color=#008000]class[/color][color=#c0c0c0] [/color][color=#008000]do[/color][color=#c0c0c0] [/color][color=#008000]its[/color][color=#c0c0c0] [/color][color=#008000]specific[/color][color=#c0c0c0] [/color][color=#008000]stuff[/color]
[color=#c0c0c0]        [/color]OnInit[color=#000000]();[/color]
[color=#c0c0c0]        [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Setup[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]timer[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]trigger[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]refresh[/color][color=#c0c0c0] [/color][color=#008000]at[/color][color=#c0c0c0] [/color][color=#008000]specified[/color][color=#c0c0c0] [/color][color=#008000]framerate[/color]
[color=#c0c0c0]        [/color]connect[color=#000000](&[/color]myTimer[color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]SIGNAL[/color][color=#000000]([/color]timeout[color=#000000]()),[/color][color=#c0c0c0] [/color][color=#808000]this[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]SLOT[/color][color=#000000]([/color]repaint[color=#000000]()));[/color]
[color=#c0c0c0]        [/color]myTimer[color=#000000].[/color]start[color=#000000]();[/color]
[color=#c0c0c0]    [/color][color=#000000]}[/color]
[color=#c0c0c0]    [/color][color=#808000]return[/color][color=#c0c0c0] [/color]QWidget[color=#000000]::[/color]event[color=#000000]([/color][color=#000000]Event[/color][color=#000000]);[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Called[/color][color=#c0c0c0] [/color][color=#000080]when[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080]needs[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]be[/color][color=#c0c0c0] [/color][color=#000080]painted[/color][color=#c0c0c0] [/color][color=#000080];[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]we[/color][color=#c0c0c0] [/color][color=#000080]use[/color][color=#c0c0c0] [/color][color=#000080]it[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]display[/color][color=#c0c0c0] [/color][color=#000080]a[/color][color=#c0c0c0] [/color][color=#000080]new[/color][color=#c0c0c0] [/color][color=#000080]frame[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]void[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]paintEvent[color=#000000]([/color]QPaintEvent[color=#000000]*)[/color]
[color=#000000]{[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Let[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]derived[/color][color=#c0c0c0] [/color][color=#008000]class[/color][color=#c0c0c0] [/color][color=#008000]do[/color][color=#c0c0c0] [/color][color=#008000]its[/color][color=#c0c0c0] [/color][color=#008000]specific[/color][color=#c0c0c0] [/color][color=#008000]stuff[/color]
[color=#c0c0c0]    [/color]OnUpdate[color=#000000]();[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Display[/color][color=#c0c0c0] [/color][color=#008000]on[/color][color=#c0c0c0] [/color][color=#008000]screen[/color]
[color=#c0c0c0]    [/color]Display[color=#000000]();[/color]
[color=#000000]}[/color]



QSFMLCanvas.hpp
[color=#000080]#ifndef[/color][color=#c0c0c0] [/color]QSFMLCANVAS_HPP
[color=#000080]#define[/color][color=#c0c0c0] [/color]QSFMLCANVAS_HPP
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Headers[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<SFML/Graphics.hpp>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QWidget>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QTimer>[/color]
[color=#808000]class[/color][color=#c0c0c0] [/color][color=#800080]QEvent[/color][color=#000000];[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas[/color][color=#c0c0c0] [/color][color=#000080]allows[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]run[/color][color=#c0c0c0] [/color][color=#000080]SFML[/color][color=#c0c0c0] [/color][color=#000080]in[/color][color=#c0c0c0] [/color][color=#000080]a[/color][color=#c0c0c0] [/color][color=#000080]Qt[/color][color=#c0c0c0] [/color][color=#000080]control[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]class[/color][color=#c0c0c0] [/color][color=#800080]QSFMLCanvas[/color][color=#c0c0c0] [/color][color=#000000]:[/color][color=#c0c0c0] [/color][color=#808000]public[/color][color=#c0c0c0] [/color][color=#800080]QWidget[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]public[/color][color=#c0c0c0] [/color][color=#800080]sf[/color][color=#000000]::[/color][color=#800080]RenderWindow[/color]
[color=#000000]{[/color]
[color=#808000]public[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Construct[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#0000ff]\param[/color][color=#c0c0c0] [/color][color=#000080]Size[/color][color=#c0c0c0] [/color][color=#000080]:[/color][color=#c0c0c0]      [/color][color=#000080]Initial[/color][color=#c0c0c0] [/color][color=#000080]size[/color][color=#c0c0c0] [/color][color=#000080]of[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#0000ff]\param[/color][color=#c0c0c0] [/color][color=#000080]FrameTime[/color][color=#c0c0c0] [/color][color=#000080]:[/color][color=#c0c0c0] [/color][color=#000080]Frame[/color][color=#c0c0c0] [/color][color=#000080]duration,[/color][color=#c0c0c0] [/color][color=#000080]in[/color][color=#c0c0c0] [/color][color=#000080]milliseconds[/color][color=#c0c0c0] [/color][color=#000080](0[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]default)[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#0000ff]\param[/color][color=#c0c0c0] [/color][color=#000080]Parent[/color][color=#c0c0c0] [/color][color=#000080]:[/color][color=#c0c0c0]    [/color][color=#000080]Parent[/color][color=#c0c0c0] [/color][color=#000080]of[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080](NULL[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]default)[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#800080]QSFMLCanvas[/color][color=#000000]([/color][color=#808000]const[/color][color=#c0c0c0] [/color][color=#800080]QSize[/color][color=#000000]&[/color][color=#c0c0c0] [/color]Size[color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]unsigned[/color][color=#c0c0c0] [/color][color=#808000]int[/color][color=#c0c0c0] [/color]FrameTime[color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#800080]QWidget[/color][color=#000000]*[/color][color=#c0c0c0] [/color]Parent[color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color]NULL[color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Destructor[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#000000]~[/color][color=#000000][i]QSFMLCanvas[/i][/color][color=#000000]();[/color]
[color=#808000]private[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Notification[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]derived[/color][color=#c0c0c0] [/color][color=#000080]class[/color][color=#c0c0c0] [/color][color=#000080]that[/color][color=#c0c0c0] [/color][color=#000080]moment[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]good[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]doing[/color][color=#c0c0c0] [/color][color=#000080]initializations[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]OnInit[/i][/color][color=#000000]();[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Notification[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]derived[/color][color=#c0c0c0] [/color][color=#000080]class[/color][color=#c0c0c0] [/color][color=#000080]that[/color][color=#c0c0c0] [/color][color=#000080]moment[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]good[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]doing[/color][color=#c0c0c0] [/color][color=#000080]its[/color][color=#c0c0c0] [/color][color=#000080]update[/color][color=#c0c0c0] [/color][color=#000080]and[/color][color=#c0c0c0] [/color][color=#000080]drawing[/color][color=#c0c0c0] [/color][color=#000080]stuff[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]OnUpdate[/i][/color][color=#000000]();[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Return[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]paint[/color][color=#c0c0c0] [/color][color=#000080]engine[/color][color=#c0c0c0] [/color][color=#000080]used[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]draw[/color][color=#c0c0c0] [/color][color=#000080]itself[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#800080]QPaintEngine[/color][color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000][i]paintEngine[/i][/color][color=#000000]()[/color][color=#c0c0c0] [/color][color=#808000]const[/color][color=#000000];[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Called[/color][color=#c0c0c0] [/color][color=#000080]each[/color][color=#c0c0c0] [/color][color=#000080]time[/color][color=#c0c0c0] [/color][color=#000080]an[/color][color=#c0c0c0] [/color][color=#000080]event[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]received[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080];[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]we[/color][color=#c0c0c0] [/color][color=#000080]use[/color][color=#c0c0c0] [/color][color=#000080]it[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]catch[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]Polish[/color][color=#c0c0c0] [/color][color=#000080]event[/color][color=#c0c0c0] [/color][color=#000080]and[/color][color=#c0c0c0] [/color][color=#000080]initialize[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]our[/color][color=#c0c0c0] [/color][color=#000080]SFML[/color][color=#c0c0c0] [/color][color=#000080]window[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]bool[/color][color=#c0c0c0] [/color][color=#000000][i]event[/i][/color][color=#000000]([/color][color=#800080]QEvent[/color][color=#000000]*[/color][color=#c0c0c0] [/color]Event[color=#000000]);[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Called[/color][color=#c0c0c0] [/color][color=#000080]when[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080]needs[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]be[/color][color=#c0c0c0] [/color][color=#000080]painted[/color][color=#c0c0c0] [/color][color=#000080];[/color]
[color=#c0c0c0]    [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]we[/color][color=#c0c0c0] [/color][color=#000080]use[/color][color=#c0c0c0] [/color][color=#000080]it[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]display[/color][color=#c0c0c0] [/color][color=#000080]a[/color][color=#c0c0c0] [/color][color=#000080]new[/color][color=#c0c0c0] [/color][color=#000080]frame[/color]
[color=#c0c0c0]    [/color][color=#008000]///[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]paintEvent[/i][/color][color=#000000]([/color][color=#800080]QPaintEvent[/color][color=#000000]*);[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Member[/color][color=#c0c0c0] [/color][color=#008000]data[/color]
[color=#c0c0c0]    [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0]    [/color][color=#800080]QTimer[/color][color=#c0c0c0] [/color][color=#800000]myTimer[/color][color=#000000];[/color][color=#c0c0c0] [/color][color=#000080]///<[/color][color=#c0c0c0] [/color][color=#000080]Timer[/color][color=#c0c0c0] [/color][color=#000080]used[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]update[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]view[/color]
[color=#000000]};[/color]
[color=#000080]#endif[/color][color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]QSFMLCANVAS_HPP[/color]


~Saint Squireen

#26 Saint Squireen   Members   -  Reputation: 181

Like
0Likes
Like

Posted 21 July 2012 - 09:32 AM

uuuuuuuummmmmmmmmmmmmmmmm.... is this what you wanted? this looks nothing like what I have in my file........

~Saint Squireen

#27 Cornstalks   Crossbones+   -  Reputation: 6974

Like
1Likes
Like

Posted 21 July 2012 - 09:36 AM

You need to paste as plain text, otherwise GameDev's text editor abusively beats the crap out of everything. There are a few ways to do this, the three I like are: 1) first paste into something like Notepad (or any plain text editor), and the copy from Notepad into your post, or 2) click the light switch icon in the top left corner of your posting to switch to plain text mode (it's above the bold "B" icon and to the left of the eraser icon), or 3) (my favorite) if you're using Chrome, paste with "Crtl+Shift+v" to do a plain text paste.

Edited by Cornstalks, 21 July 2012 - 09:47 AM.

[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#28 Saint Squireen   Members   -  Reputation: 181

Like
0Likes
Like

Posted 21 July 2012 - 08:05 PM

sorry ive been gone all day:( and i cant really do this till tomorrow sorry. and thanks for the insight Cornstalks, Ill try it it a soon as possible!!!!!

~Saint Squireen




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS