summaryrefslogtreecommitdiff
path: root/lib/wx/doc/src/wxGLContext.xml
blob: 60214ff35b7b1f68ac7aa4602d384ee60e714750 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year><year>2021</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxGLContext</title>
</header>
<module>wxGLContext</module>
<modulesummary>Functions for wxGLContext class</modulesummary>
<description><p>An instance of a <seeerl marker="wxGLContext"><c>wxGLContext</c></seeerl> represents the state of an OpenGL state machine and the connection between OpenGL and the system.
      </p><p>The OpenGL state includes everything that can be set with the OpenGL API: colors, rendering variables, buffer data ids, texture objects, etc. It is possible to have multiple rendering contexts share buffer data and textures. This feature is specially useful when the application use multiple threads for updating data into the memory of the graphics card.
      </p><p>Whether one only rendering context is used with or bound to multiple output windows or if each window has its own bound context is a developer decision. It is important to take into account that GPU makers may set different pointers to the same OGL function for different contexts. The way these pointers are retrieved from the OGL driver should be used again for each new context.
      </p><p>Binding (making current) a rendering context with another instance of a <seeerl marker="wxGLCanvas"><c>wxGLCanvas</c></seeerl> however works only if the both <seeerl marker="wxGLCanvas"><c>wxGLCanvas</c></seeerl> instances were created with the same attributes.
      </p><p>OpenGL version 3 introduced a new type of specification profile, the modern core profile. The old compatibility profile maintains all legacy features. Since wxWidgets 3.1.0 you can choose the type of context and even ask for a specified OGL version number. However, its advised to use only core profile as the compatibility profile may run a bit slower.
      </p><p>OpenGL core profile specification defines several flags at context creation that determine not only the type of context but also some features. Some of these flags can be set in the list of attributes used at <seeerl marker="wxGLCanvas"><c>wxGLCanvas</c></seeerl> ctor. But since wxWidgets 3.1.0 it is strongly encouraged to use the new mechanism: setting the context attributes with a <c>wxGLContextAttrs</c> (not implemented in wx) object and the canvas attributes with a <c>wxGLAttributes</c> (not implemented in wx) object.
      </p><p>The best way of knowing if your OpenGL environment supports a specific type of context is creating a <seeerl marker="wxGLContext"><c>wxGLContext</c></seeerl> instance and checking <c>wxGLContext::IsOK()</c> (not implemented in wx). If it returns false, then simply delete that instance and create a new one with other attributes.
      </p><p>wxHAS_OPENGL_ES is defined on platforms that only have this implementation available (e.g. the iPhone) and don't support the full specification.
      </p><p>See: <seeerl marker="wxGLCanvas"><c>wxGLCanvas</c></seeerl>, <c>wxGLContextAttrs</c> (not implemented in wx), <c>wxGLAttributes</c> (not implemented in wx)
      </p>
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_g_l_context.html">wxGLContext</url></p>
  </description>
<datatypes><datatype><name name="wxGLContext"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>new/2</c></fsummary>
  </func>
  
  <func>
    <name name="new" arity="2" clause_i="1" since=""/>
    <fsummary>Constructor. </fsummary>
    <desc><p>Constructor. 
      </p></desc>
  </func>
  
  <func>
    <name name="setCurrent" arity="2" clause_i="1" since=""/>
    <fsummary>Makes the OpenGL state that is represented by this rendering context current with the <c>wxGLCanvas</c> <c>win</c>. </fsummary>
    <desc><p>Makes the OpenGL state that is represented by this rendering context current with the <seeerl marker="wxGLCanvas"><c>wxGLCanvas</c></seeerl> <c>win</c>. 
      </p><p>Note: <c>win</c> can be a different <seeerl marker="wxGLCanvas"><c>wxGLCanvas</c></seeerl> window than the one that was passed to the constructor of this rendering context. If <c>RC</c> is an object of type <seeerl marker="wxGLContext"><c>wxGLContext</c></seeerl>, the statements <c>"RC.SetCurrent(win);"</c> and <c>"win.SetCurrent(RC);"</c> are equivalent, see <seemfa marker="wxGLCanvas#setCurrent/2"><c>wxGLCanvas:setCurrent/2</c></seemfa>. 
      </p></desc>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destructor</fsummary>
    <desc><p>Destroys the object.</p></desc>
  </func>
  </funcs>
</erlref>