[OpenR8 library] OpenGL (Display images with the 3D acceleration function of the display card)
  1. OpenGL introduction

 

OpenGL full name is Open Graphics Library, which displays the 3D acceleration feature of the adapter to display the image.

 

Because OpenGL's function library is used to WxWidgets, you need to pull the "Start WxWidgets feature" function before using OpenGL functions, so that you can successfully use the functionality of the OpenGL function, the flow of which is shown in Fig. 1.

 

Fig. 1.OpenGL diagram.png

Fig. 1.OpenGL diagram.

 

※ For instructions on OpenGL solutions, refer to [OpenR8 solution] OpenGL (display images with the 3D acceleration feature of the display adapter).

 

 

  1. OpenGL library introduction

 

OpenGL's Library contains 5 functions, as shown in Fig. 2, and OpenGL uses the WxWidgets (Fig. 2 blue function), so you must start the WxWidgets feature before you can use the OpenGL function.

 

Fig. 2.OpenGL Library function.png

Fig. 2.OpenGL Library function.

 

"OpenGL_NewWindow": Establish the OpenGL window.

 

Parameter number segment:

  • OpenGLWindow: Creates a named OpenGL window object.
  • OpenGLWindowTitle: Name the window title of OpenGL (what name the window is going to call).

 

Example: 

Performing the two processes on the left of Fig. 3 creates a named OpenGL window.

 

Fig. 3.Nomenclature of.png

Fig. 3.Nomenclature of "OpenGL_NewWindow".

 

"OpenGL_ShowWindow": Display the OpenGL window.

 

Parameter number segment:

  • OpenGLwindow: Select the Window object created by the "OpenGL_New Window".

 

Example:

Perform the three processes on the left of Fig. 4 and display the named OpenGL window.

 

※ Be sure to "OpenGL_NewWindow" before you can "OpenGL_ShowWindow".

 

Fig. 4.The window of.png

Fig. 4.The window of "OpenGL_ShowWindow" shows.

 

"OpenGL_ShowImage": Display the image in the OpenGL window.

 

Parameter number segment:

  • OpenGLWindow: Select the window object created by "Opengl_NewWindow".
  • Image: The image to display in the OpenGL window.

 

Example:

Performing the left process in Fig. 5 displays an "Image_Open" in the OpenGL window.

 

Must first "OpenGL_ShowWindow", in order to "OpenGL_ShowImage".

 

Fig. 5..png

Fig. 5."OpenGL_ShowImage" displays an image of "Image_Open" in the OpenGL window.

 

"OpenGL_GetImage": Retrieve the image displayed in the OpenGL window.

 

Parameter number segment:

  • OpenGLWindow: Select the window object created by "OpenGL_NewWindow".
  • Image: Retrieve the image displayed in the OpenGL window.

 

Example:

※ Prerequisites: To use the "OpenGL_GetImage" function, the OpenGL window must be a display state and the image cannot be retrieved in

"OpenGL_HideWindow" mode.

Performing the left process in Fig. 6 retrieves the image that appears in "Opengl_ShowWindow".

 

Fig. 6.Retrieve the image displayed in the OpenGL window.png

Fig. 6.Retrieve the image displayed in the OpenGL window.

 

"OpenGL_HideWindow": Hide the OpenGL window.

 

Parameter number segment:

  • OpenGLWindow: Select the window object you want to hide.

 

Example:

Perform the left process in Fig. 7, and finally the OpenGL window is hidden.

 

Note: If you want to display the window again, and then pull down a "OpenGL_ShowWindow" function, you can display the OpenGL window again, as shown in Fig. 8.

 

Fig. 7.Hide OpenGL window.png

Fig. 7.Hide OpenGL window.

 

Fig. 8.Display the hidden OpenGL window again.png

Fig. 8.Display the hidden OpenGL window again.


Recommended Article

1.
OpenR8 - AI Software for Everyone (Download)