User Tools

Site Tools


opengl_20programming

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
opengl_20programming [2018/04/13 16:17]
richardrussell Added syntax highlighting
opengl_20programming [2018/08/25 11:13] (current)
richardrussell Amended for BB4W v6
Line 91: Line 91:
 </​code>​ </​code>​
  
-Note particularly that each //double// parameter must be passed as a pair of values, the first using **FN_dl** and the second using **FN_dh**. When there is a choice, passing single-precision values will usually be easier.\\ \\  Some OpenGL functions require an array of values. In this case it is easier to pass a double-precision array, since BBC BASIC for Windows supports this data type natively (in ***FLOAT64** mode). For example to call **glLoadMatrixd** you would use code similar to the following:+Note particularly that each //double// parameter must be passed as a pair of values, the first using **FN_dl** and the second using **FN_dh**. When there is a choice, passing single-precision values will usually be easier.\\ \\  Some OpenGL functions require an array of values. In this case it is easier to pass a double-precision array, since BBC BASIC for Windows supports this data type natively (by using the # suffix). For example to call **glLoadMatrixd** you would use code similar to the following:
  
 <code bb4w> ​ <code bb4w> ​
-        DIM matrix(3,​3) +        DIM matrix#(3,3) 
-        matrix() = a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 +        matrix#() = a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 
-        matrix() *= 1.0 +        matrix#() *= 1.0 
-        SYS `glLoadMatrixd`,​ ^matrix(0,​0)+        SYS `glLoadMatrixd`,​ ^matrix#(0,0)
 </​code>​ </​code>​
  
-Note that for this to work your program must be in ***FLOAT64** mode.\\ \\ +
 ===== Rendering ===== ===== Rendering =====
 \\  OpenGL under Windows uses a //​double-buffering//​ scheme. Objects are first rendered to an off-screen bitmap and then, when the entire frame is complete, //swapped// onto the display. The rendering loop will typically be of the following form: \\  OpenGL under Windows uses a //​double-buffering//​ scheme. Objects are first rendered to an off-screen bitmap and then, when the entire frame is complete, //swapped// onto the display. The rendering loop will typically be of the following form:
opengl_20programming.txt · Last modified: 2018/08/25 11:13 by richardrussell