Skip to content

Instantly share code, notes, and snippets.

@FRex
Created October 20, 2017 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FRex/7a2b6e2bfc845050d59868c771cec03f to your computer and use it in GitHub Desktop.
Save FRex/7a2b6e2bfc845050d59868c771cec03f to your computer and use it in GitHub Desktop.
#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