Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////
- // Headers
- ////////////////////////////////////////////////////////////
- #include <SFML/Graphics.hpp>
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #include <GL/gl.h>
- #include <GL/glu.h>
- #include <iostream>
- unsigned long buffer[] = {
- 16u, 16,
- 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 338034905u, 3657433343u, 0u, 184483840u, 234881279u, 3053453567u, 3221225727u, 1879048447u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1224737023u, 3305111807u, 3875537151u,0u, 0u, 2063597823u, 1291845887u, 0u, 67109119u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 50266112u, 3422552319u, 0u, 0u, 3070230783u, 2063597823u, 2986344703u, 771752191u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 3422552319u, 0u, 0u, 3372220671u, 1509949695u, 704643327u, 3355443455u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 0u, 3422552319u, 0u, 134152192u, 3187671295u, 251658495u, 0u, 3439329535u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 3422552319u, 0u, 0u, 2332033279u, 1342177535u, 167772415u, 3338666239u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 0u, 3422552319u, 0u, 0u, 436207871u, 3322085628u, 3456106751u, 1375731967u, 4278255360u, 4026597120u, 3758161664u, 3489726208u, 3204513536u, 2952855296u, 2684419840u, 2399207168u, 2130771712u, 1845559040u, 1593900800u, 1308688128u, 1040252672u, 755040000u, 486604544u, 234946304u, 4278255360u, 4043374336u, 3774938880u, 3506503424u, 3221290752u, 2952855296u, 2667642624u, 2399207168u, 2130771712u, 1862336256u, 1627453957u, 1359017481u, 1073805064u, 788591627u, 503379721u, 218169088u, 4278255360u, 4043374336u, 3758161664u, 3506503424u, 3221290752u, 2952855296u, 2684419840u, 2415984384u, 2130771712u, 1862336256u, 1577123584u, 1308688128u, 1040252672u, 755040000u, 486604544u, 218169088u, 4278190335u, 4026532095u, 3758096639u, 3489661183u, 3221225727u, 2952790271u, 2667577599u, 2415919359u, 2130706687u, 1862271231u, 1593835775u, 1325400319u, 1056964863u, 771752191u, 520093951u, 234881279u, 4278190335u, 4026532095u, 3758096639u, 3489661183u, 3221225727u, 2952790271u, 2667577599u, 2415919359u, 2130706687u, 1862271231u, 1593835775u, 1325400319u, 1056964863u, 771752191u, 503316735u, 234881279u, 4278190335u, 4026532095u, 3758096639u, 3489661183u, 3221225727u, 2952790271u, 2684354815u, 2399142143u, 2130706687u, 1862271231u, 1593835775u, 1325400319u, 1040187647u, 771752191u, 520093951u, 234881279u, 4294901760u, 4043243520u, 3774808064u, 3506372608u, 3221159936u, 2952724480u, 2684289024u, 2399076352u, 2147418112u, 1862205440u, 1593769984u, 1308557312u, 1040121856u, 771686400u, 503250944u, 234815488u, 4294901760u, 4060020736u, 3758030848u, 3506372608u, 3221159936u, 2952724480u, 2684289024u, 2415853568u, 2130640896u, 1862205440u, 1593769984u, 1308557312u, 1040121856u, 771686400u, 503250944u, 234815488u, 4294901760u, 4043243520u, 3774808064u, 3489595392u, 3237937152u, 2952724480u, 2684289024u, 2415853568u, 2147418112u, 1862205440u, 1593769984u, 1325334528u, 1056899072u, 788463616u, 503250944u, 234815488,
- 32u, 32,
- 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 268369920u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 1509949695u, 3120562431u, 4009754879u, 4194304255u, 3690987775u, 2130706687u, 83886335u, 0u, 50331903u, 1694499071u, 3170894079u, 3992977663u, 4211081471u, 3657433343u, 1879048447u, 16777471u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 3087007999u, 2281701631u, 1191182591u, 1040187647u, 2030043391u, 4127195391u, 2566914303u, 0u, 16777471u, 3254780159u, 2181038335u, 1191182591u, 973078783u, 2030043391u,4177527039u, 2130706687u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 0u, 0u, 0u, 0u, 0u, 2214592767u, 4093640959u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 2298478847u, 3909091583u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 2214592767u, 3607101695u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1946157311u, 4093640959u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 0u, 0u, 536871167u, 1191182591u, 2281701631u,3019899135u, 637534463u, 0u, 0u, 0u, 100597760u, 251592704u, 33488896u, 0u, 3321889023u, 2919235839u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 2550137087u, 4278190335u, 4278190335u, 3405775103u, 570425599u, 0u, 0u, 0u, 0u, 0u, 0u, 2046820607u, 4043309311u, 620757247u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 33488896u, 0u, 0u, 218104063u, 1291845887u, 3841982719u, 3388997887u, 0u, 0u, 0u, 0u, 0u, 1996488959u, 4093640959u, 1073742079u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1761607935u, 4278190335u, 150995199u, 0u, 0u, 67109119u, 2550137087u, 3909091583u, 889192703u, 0u, 0u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 0u, 0u, 0u, 0u, 0u, 2181038335u, 3925868799u, 0u, 0u, 218104063u, 3070230783u, 3623878911u, 570425599u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 805306623u, 3288334591u, 1795162367u, 1040187647u, 1023410431u, 2231369983u, 4211081471u, 1694499071u, 0u, 369099007u, 3456106751u, 3825205503u, 1174405375u, 872415487u, 872415487u, 872415487u, 872415487u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4293984270u, 2046951677u, 3422552319u, 4110418175u, 4177527039u, 3405775103u, 1409286399u, 0u, 0u, 1409286399u, 4278190335u, 4278190335u, 4278190335u, 4278190335u, 4278190335u, 4278190335u, 4278190335u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u,4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 4294901760u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0,0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 4278255360u, 4144037632u, 4009819904u, 3875602176u, 3741384448u, 3607166720u, 3472948992u, 3338731264u, 3204513536u, 3053518592u, 2936078080u, 2801860352u, 2650865408u, 2516647680u, 2382429952u, 2264989440u, 2113994496u, 1996553984u, 1862336256u, 1728118528u, 1577123584u, 1459683072u, 1325465344u, 1191247616u, 1040252672u, 922812160u, 771817216u, 637599488u, 503381760u, 385941248u, 234946304u, 100728576u, 4278255360u, 4144037632u, 4009819904u, 3875602176u, 3724607232u, 3607166720u, 3472948992u, 3338731264u, 3204513536u, 3070295808u, 2936078080u, 2801860352u, 2667642624u, 2516647680u, 2399207168u, 2264989440u, 2130771712u, 1996553984u, 1845559040u, 1728118528u, 1593900800u, 1459683072u, 1308688128u, 1191247616u, 1057029888u, 922812160u, 788594432u, 637599488u, 503381760u, 369164032u, 234946304u, 117505792u, 4278255360u, 4144037632u, 4009819904u, 3875602176u, 3741384448u, 3607166720u, 3472948992u, 3338731264u, 3204513536u, 3053518592u, 2919300864u, 2801860352u, 2650865408u, 2533424896u, 2399207168u, 2264989440u, 2113994496u, 1996553984u, 1862336256u, 1728118528,1593900800u, 1459683072u, 1325465344u, 1191247616u, 1040252672u, 906034944u, 771817216u, 654376704u, 503381760u, 369164032u, 234946304u, 117505792u, 4278255360u, 4144037632u, 4009819904u, 3858824960u, 3741384448u, 3607166720u, 3472948992u, 3338731264u, 3204513536u, 3070295808u, 2936078080u, 2801860352u, 2667642624u, 2533424896u, 2382429952u, 2264989440u, 2130771712u, 1979776768u, 1862336256u, 1728118528u, 1577123584u, 1442905856u, 1325465344u, 1191247616u, 1040252672u, 922812160u, 771817216u, 637599488u, 503381760u, 369164032u, 234946304u, 100728576u, 4278255360u, 4144037632u, 4009819904u, 3875602176u, 3741384448u, 3607166720u, 3472948992u, 3338731264u, 3204513536u, 3070295808u, 2919300864u, 2801860352u, 2667642624u, 2533424896u, 2399207168u, 2264989440u, 2113994496u, 1996553984u, 1862336256u, 1728118528u, 1593900800u, 1442905856u, 1342241795u, 1174470400u, 1057029888u, 906034944u, 788594432u, 654376704u, 503381760u, 385941248u, 251723520u, 100728576u, 4278190335u, 4160749823u, 4026532095u, 3892314367u, 3741319423u, 3623878911u, 3472883967u, 3338666239u, 3221225727u, 3070230783u, 2952790271u, 2818572543u, 2667577599u, 2533359871u, 2399142143u, 2264924415u, 2147483903u, 1996488959u, 1862271231u, 1728053503u, 1593835775u, 1459618047u, 1325400319u, 1191182591u, 1056964863u, 922747135u, 788529407u, 654311679u, 520093951,385876223u, 251658495u, 117440767u, 4278190335u, 4160749823u, 4026532095u, 3892314367u, 3741319423u, 3623878911u, 3489661183u, 3355443455u, 3221225727u, 3087007999u, 2936013055u, 2801795327u, 2667577599u, 2533359871u, 2399142143u, 2281701631u, 2130706687u, 1996488959u, 1862271231u, 1728053503u, 1593835775,1459618047u, 1325400319u, 1191182591u, 1056964863u, 922747135u, 788529407u, 654311679u, 520093951u, 385876223u, 234881279u, 100663551u, 4278190335u, 4160749823u, 4026532095u, 3892314367u, 3758096639u, 3623878911u, 3489661183u, 3355443455u, 3221225727u, 3087007999u, 2936013055u, 2801795327u, 2667577599u, 2550137087u, 2415919359u, 2264924415u, 2130706687u, 1996488959u, 1862271231u, 1728053503u, 1593835775u, 1459618047u, 1325400319u, 1191182591u, 1056964863u, 922747135u, 788529407u, 654311679u, 503316735u, 369099007u, 251658495u, 100663551u, 4278190335u, 4160749823u, 4026532095u, 3892314367u, 3758096639u, 3623878911u, 3489661183u, 3355443455u, 3204448511u, 3087007999u, 2936013055u, 2818572543u, 2667577599u, 2533359871u, 2399142143u, 2264924415u, 2130706687u, 1996488959u, 1879048447u, 1728053503u, 1593835775u, 1459618047u, 1325400319u, 1191182591u, 1056964863u, 922747135u, 788529407u, 654311679u, 520093951u, 385876223u, 251658495u, 117440767u, 4278190335u, 4160749823u, 4026532095u, 3892314367u, 3758096639u, 3623878911u, 3489661183u, 3355443455u, 3221225727u, 3087007999u, 2952790271u, 2818572543u, 2667577599u, 2533359871u, 2399142143u, 2264924415u, 2147483903u, 2013266175u, 1862271231u, 1744830719u, 1610612991u, 1476395263u, 1342177535u, 1191182591u, 1056964863u, 922747135u, 788529407u, 654311679u, 520093951u, 385876223u, 251658495u, 100663551u, 4294901760u, 4160684032u, 4026466304u, 3909025792u, 3774808064u, 3623813120u, 3489595392u, 3355377664u, 3237937152u, 3103719424u, 2952724480u, 2818506752u, 2684289024u, 2550071296u, 2415853568u, 2281635840u, 2147418112u, 2013200384u, 1878982656u, 1744764928u, 1593769984u, 1476329472,1325334528u, 1207894016u, 1056899072u, 939458560u, 788463616u, 654245888u, 520028160u, 385810432u, 251592704u, 117374976u, 4294901760u, 4177461248u, 4043243520u, 3909025792u, 3774808064u, 3640590336u, 3506372608u, 3355377664u, 3221159936u, 3086942208u, 2952724480u, 2818506752u, 2701066240u, 2550071296u, 2415853568u, 2281635840u, 2147418112u, 2013200384u, 1878982656u, 1727987712u, 1610547200u, 1476329472u, 1325334528u, 1191116800u, 1073676288u, 922681344u, 788463616u, 654245888u, 520028160u, 385810432u, 251592704u, 100597760u, 4294901760u, 4177461248u, 4043243520u, 3909025792u, 3774808064u, 3640590336u, 3489595392u, 3372154880u, 3237937152u, 3103719424u, 2952724480u, 2818506752u, 2700935170u, 2550071296u, 2415853568u, 2281635840u, 2147418112u, 2013200384u, 1878982656u, 1744764928u, 1610547200u, 1459552256u, 1342111744u, 1191116800u, 1056899072u, 922681344u, 788463616u, 671023104u, 520028160u, 385810432u, 251592704u, 100597760u, 4294901760u, 4177461248u, 4043243520u, 3909025792u, 3774808064u, 3640590336u, 3489595392u, 3372154880u, 3237937152u, 3086942208u, 2969501696u, 2818506752u, 2684289024u, 2550071296u, 2432630784u, 2281635840u, 2147418112u, 2013200384u, 1862205440u, 1744764928u, 1610547200u, 1476329472u, 1342111744u, 1191116800u, 1056899072u, 922681344u, 788463616u, 654245888u, 520028160u, 385810432u, 251592704u, 117374976u, 4294901760u, 4177461248u, 4043243520u, 3909025792u, 3774808064u, 3623813120u, 3506372608u, 3372154880u, 3237937152u, 3103719424u, 2952724480u, 2835283968u, 2684289024u, 2550071296u, 2432630784u, 2281635840u, 2147418112u, 2046492676u, 1862205440u, 1744764928u, 1610547200u, 1476329472u, 1342111744,1207894016u, 1056899072u, 939458560u, 788463616u, 654245888u, 536281096u, 385810432u, 251592704u, 134152192u,
- };
- ////////////////////////////////////////////////////////////
- /// Initialize OpenGL states into the specified view
- ///
- /// \param Window Target window to initialize
- ///
- ////////////////////////////////////////////////////////////
- void initialize(sf::Window& window)
- {
- // Activate the window
- window.setActive();
- // Setup OpenGL states
- // Set color and depth clear value
- glClearDepth(1.f);
- glClearColor(0.f, 0.5f, 0.5f, 0.f);
- // Enable Z-buffer read and write
- glEnable(GL_DEPTH_TEST);
- glDepthMask(GL_TRUE);
- // Setup a perspective projection
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(90.f, 1.f, 1.f, 500.f);
- }
- ////////////////////////////////////////////////////////////
- /// Draw the OpenGL scene (a rotating cube) into
- /// the specified view
- ///
- /// \param window Target window for rendering
- /// \param elapsedTime Time elapsed since the last draw
- ///
- ////////////////////////////////////////////////////////////
- void draw(sf::Window& window, float elapsedTime)
- {
- // Activate the window
- window.setActive();
- // Clear color and depth buffers
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- // Apply some transformations
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0.f, 0.f, -200.f);
- glRotatef(elapsedTime * 0.05f, 1.f, 0.f, 0.f);
- glRotatef(elapsedTime * 0.03f, 0.f, 1.f, 0.f);
- glRotatef(elapsedTime * 0.09f, 0.f, 0.f, 1.f);
- // Draw a cube
- glBegin(GL_QUADS);
- glColor3f(1.f, 1.f, 0.f);
- glVertex3f(-50.f, -50.f, -50.f);
- glVertex3f(-50.f, 50.f, -50.f);
- glVertex3f( 50.f, 50.f, -50.f);
- glVertex3f( 50.f, -50.f, -50.f);
- glColor3f(1.f, 1.f, 0.f);
- glVertex3f(-50.f, -50.f, 50.f);
- glVertex3f(-50.f, 50.f, 50.f);
- glVertex3f( 50.f, 50.f, 50.f);
- glVertex3f( 50.f, -50.f, 50.f);
- glColor3f(0.f, 1.f, 1.f);
- glVertex3f(-50.f, -50.f, -50.f);
- glVertex3f(-50.f, 50.f, -50.f);
- glVertex3f(-50.f, 50.f, 50.f);
- glVertex3f(-50.f, -50.f, 50.f);
- glColor3f(0.f, 1.f, 1.f);
- glVertex3f(50.f, -50.f, -50.f);
- glVertex3f(50.f, 50.f, -50.f);
- glVertex3f(50.f, 50.f, 50.f);
- glVertex3f(50.f, -50.f, 50.f);
- glColor3f(1.f, 0.f, 1.f);
- glVertex3f(-50.f, -50.f, 50.f);
- glVertex3f(-50.f, -50.f, -50.f);
- glVertex3f( 50.f, -50.f, -50.f);
- glVertex3f( 50.f, -50.f, 50.f);
- glColor3f(1.f, 0.f, 1.f);
- glVertex3f(-50.f, 50.f, 50.f);
- glVertex3f(-50.f, 50.f, -50.f);
- glVertex3f( 50.f, 50.f, -50.f);
- glVertex3f( 50.f, 50.f, 50.f);
- glEnd();
- }
- ////////////////////////////////////////////////////////////
- /// Entry point of application
- ///
- /// \return Error code
- ///
- ////////////////////////////////////////////////////////////
- int main()
- {
- // Open a connection with the X server
- Display* display = XOpenDisplay(NULL);
- if (!display)
- return EXIT_FAILURE;
- // Get the default screen
- int screen = DefaultScreen(display);
- // Let's create the main window
- XSetWindowAttributes attributes;
- attributes.background_pixel = BlackPixel(display, screen);
- attributes.event_mask = KeyPressMask;
- Window window = XCreateWindow(display, RootWindow(display, screen),
- 0, 0, 650, 330, 0,
- DefaultDepth(display, screen),
- InputOutput,
- DefaultVisual(display, screen),
- CWBackPixel | CWEventMask, &attributes);
- Atom net_wm_icon = XInternAtom(display, "_NET_WM_ICON", False);
- Atom cardinal = XInternAtom(display, "CARDINAL", False);
- int length = 2 + 16 * 16 + 2 + 32 * 32;
- XChangeProperty(display, window, net_wm_icon, cardinal, 32, PropModeReplace, (const unsigned char*) buffer, length);
- if (!window)
- return EXIT_FAILURE;
- // Set the window's name
- XStoreName(display, window , "SFML Window");
- // Let's create the windows which will serve as containers for our SFML views
- Window view1 = XCreateWindow(display, window,
- 10, 10, 310, 310, 0,
- DefaultDepth(display, screen),
- InputOutput,
- DefaultVisual(display, screen),
- 0, NULL);
- Window view2 = XCreateWindow(display, window,
- 330, 10, 310, 310, 0,
- DefaultDepth(display, screen),
- InputOutput,
- DefaultVisual(display, screen),
- 0, NULL);
- // Show our windows
- XMapWindow(display, window);
- XFlush(display);
- // Create our SFML views
- sf::Window SFMLView1(view1);
- sf::Window SFMLView2(view2);
- // Create a clock for measuring elapsed time
- sf::Clock clock;
- // Initialize our views
- initialize(SFMLView1);
- initialize(SFMLView2);
- // Start the event loop
- bool running = true;
- while (running)
- {
- while (XPending(display))
- {
- // Get the next pending event
- XEvent event;
- XNextEvent(display, &event);
- // Process it
- switch (event.type)
- {
- case sf::Event::Closed :
- running = false;
- break;
- }
- }
- // Draw something into our views
- draw(SFMLView1, clock.getElapsedTime().asSeconds());
- draw(SFMLView2, clock.getElapsedTime().asSeconds() * 0.3f);
- // Display the views on screen
- SFMLView1.display();
- SFMLView2.display();
- }
- // Close the display
- XCloseDisplay(display);
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement