Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: OIS with GLUT  (Read 1684 times)

feelie

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 4
    • View Profile
OIS with GLUT
« on: October 25, 2007, 11:10:01 AM »

Hi

Does anybody know how to use OIS with the GLUT framework for opengl. The problem I seem to be having is with the InputManager creation. I passed a window handler that I got from
Code: [Select]
        HWND hWnd;
hWnd = FindWindow("FREEGLUT", "WindowTitle");

But I don't know if that counts as the opengl window made with GLUT or the console window in the background which GLUT runs from. When I run the program the opengl stuff shows but the console shows the error "The sent HWND is not valid!" Is there a way of checking which handle I am sending because I know I can't pass a console window handle?

Thanks
Logged

feelie

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 4
    • View Profile
Re: OIS with GLUT
« Reply #1 on: November 01, 2007, 12:57:16 AM »

Nevermind, found the problem. When converting HWND to a string I forgot to cast it to size_t.
Silly me
Logged

mustill

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
    • View Profile
Re: OIS with GLUT
« Reply #2 on: November 06, 2007, 08:10:07 AM »

Hi,
I want to use OIS in my GLUT project as well, but I use it on Linux too. Is it possible to use it that way? How can I init OIS?

Thanks...
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: OIS with GLUT
« Reply #3 on: November 07, 2007, 02:54:27 PM »

You need to pass in the X11 window handle on Linux, not sure how you get that from Glut, but likely is possible.
Logged

feelie

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 4
    • View Profile
Re: OIS with GLUT
« Reply #4 on: November 08, 2007, 10:24:10 PM »

GLUT doesn't have a get handle function. With windows I used the windows api to get the handle, its actually a bit messy because you have to pass the window name to it. But anyway if there is a linux equivalent to #include <windows.h> then you'll have to use that.
Logged

hug0

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Re: OIS with GLUT
« Reply #5 on: December 04, 2009, 04:41:28 AM »

sorry, to push that old thread:
I am also looking for a way to get the GLUT handle in linux.
What is the equivalent to the win version?
Thx!
Logged