Created
October 20, 2017 21:46
-
-
Save FRex/7a2b6e2bfc845050d59868c771cec03f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
#include <Windows.h> | |
#include <iostream> | |
int main(int argc, char ** argv) | |
{ | |
sf::RenderWindow app(sf::VideoMode(640u, 480u), "DoubleClick"); | |
app.setFramerateLimit(60u); | |
sf::String title; | |
sf::WindowHandle winhandle = app.getSystemHandle(); | |
HIMC imehandle = 0x0; | |
while(app.isOpen()) | |
{ | |
sf::Event eve; | |
while(app.pollEvent(eve)) | |
{ | |
switch(eve.type) | |
{ | |
case sf::Event::Closed: | |
app.close(); | |
break; | |
case sf::Event::KeyPressed: | |
std::cout << eve.key.code << std::endl; | |
break; | |
case sf::Event::TextEntered: | |
title += eve.text.unicode; | |
app.setTitle(title); | |
break; | |
case sf::Event::MouseButtonPressed: | |
imehandle = ImmAssociateContext(winhandle, imehandle); | |
break; | |
}//switch eve.type | |
} | |
app.clear(); | |
app.display(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment