glfw若干函数列表

1. int glfwInit( void )  返回值 GL_TRUE 或者 GL_FALSE

2. void glfwTerminate( void )

屏幕设置

3.  int glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode ) 

    mode可选值: GLFW_FULLSCREEN , GLFW_WINDOW

4.  void glfwCloseWindow( void )

 

关于键盘

5. int glfwGetKey( int key )

 

交换前后端渲染缓冲

6. glfwSwapBuffers();

7. glfwPollEvents()

 

屏幕设置

标题设置

8. void glfwSetWindowTitle( const char *title )

9. void glfwOpenWindowHint( int target, int hint )

改变屏幕尺寸

10. void glfwSetWindowSize( int width, int height)

11. void glfwSetWindowPos( int x, int y )

 

查询屏幕属性

12.int glfwGetWindowParam( int param )

13.void glfwSetWindowSizeCallback( GLFWwindowsizefun cbfun )

14. cbfun应该是这样的 void GLFWCALL fun( int width, int height )

15. void glfwGetWindowSize( int *width, int *height )

 

 

渲染

16.void glfwSwapBuffers( void )

17. void glfwSwapInterval( int interval )  (选择最小的number of vertical retraces the video raster line should do before swapping the buffers)

 

查询视频模式

18. int glfwGetVideoModes( GLFWvidmode *list, int maxcount )

模式结构如下:

typedef struct

{
     int Width, Height; // Video resolution
     int RedBits; // Red bits per pixel
     int GreenBits; // Green bits per pixel
     int BlueBits; // Blue bits per pixel
} GLFWvidmode;

19. void glfwGetDesktopMode( GLFWvidmode *mode )

 

输入处理

GLFW gives three options for getting keyboard input:
 Manually polling the state of individual keys.
 Automatically receive new key state for any key, using a callback function.
 Automatically receive characters, using a callback function.

检查一个键按下了没有使用

20. int glfwGetKey( int key )

在处理连锁键的时候就要

21.glfwEnable( GLFW_STICKY_KEYS );

当然也可以使用

22. void glfwSetKeyCallback( GLFWkeyfun cbfun )

 

字符输入

23. void glfwSetCharCallback( GLFWcharfun cbfun )

这里:

The argument fun is a pointer to a callback function. The callback function shall take two integer arguments. The first is a Unicode character code, and the second is GLFW_PRESS if the key that generated the character was pressed, or GLFW_RELEASE if it was released.

24.键重复 glfwEnable( GLFW_KEY_REPEAT );

25. 特殊系统键glfwDisable( GLFW_SYSTEM_KEYS );

 

鼠标输入

26. void glfwGetMousePos( int *x, int *y )    这里x,y是鼠标的绝对路径

27. void glfwSetMousePosCallback( GLFWmouseposfun cbfun )  这是回调函数

28. int glfwGetMouseButton( int button ) 这是鼠标按键

这里 int 可以为:

GLFW_MOUSE_BUTTON_LEFT

GLFW_MOUSE_BUTTON_RIGHT 

GLFW_MOUSE_BUTTON_MIDDLE

29. void glfwSetMouseButtonCallback( GLFWmousebuttonfun fun )

获取鼠标滑轮位置

30. int glfwGetMouseWheel( void )

31. void glfwSetMouseWheelCallback( GLFWmousewheelfun fun )
32. 隐藏鼠标 glfwDisable( GLFW_MOUSE_CURSOR );

33.开启鼠标  glfwEnable( GLFW_MOUSE_CURSOR );

关于jostick

34. int glfwGetJoystickParam( int joy, int param )

35. int glfwGetJoystickPos( int joy, float *pos, int numaxes )

36. int glfwGetJoystickButtons( int joy, unsigned

 

 

glfw在定时方面的应用

37. double glfwGetTime( void )

38. void glfwSetTime( double time )

39. void glfwSleep( double time )

 

读入图片

从tga获取数据

40. int glfwLoadTexture2D( const char *name, int flags )

41. int glfwReadImage( const char *name, GLFWimage *img, int flags )

42. void glfwFreeImage( GLFWimage *img )

 

 

感觉蛮简单的  过年好好学学这个-_-

你可能感兴趣的:(Integer,callback,character,button,fun,keyboard)