The reason for looking for an afternoon: the original sentence
glBufferData
(
GLenum
(
GL_ARRAY_BUFFER
),
MemoryLayout
.
size
(ofValue:
vertices
)
.
vertices
,
GLenum
(
GL_STATIC_DRAW
In SWIFT2, the sizeof method is replaced with the memoryLayout method. The memoryLayout. Size (ofValue: vertices) retrieves only one of the vertices in the array, so it needs to be multiplied by the number. GlBufferData (GLenum(GL_ARRAY_BUFFER), memorylayout.size (ofValue: vertices)*6, vertices, GLenum(GL_STATIC_DRAW))
glBufferData
(
GLenum
(
GL_ARRAY_BUFFER
),
MemoryLayout
.
size
(ofValue:
vertices
)
.
vertices
,
GLenum
(
GL_STATIC_DRAW
In SWIFT2, the sizeof method is replaced with the memoryLayout method. The memoryLayout. Size (ofValue: vertices) retrieves only one of the vertices in the array, so it needs to be multiplied by the number. GlBufferData (GLenum(GL_ARRAY_BUFFER), memorylayout.size (ofValue: vertices)*6, vertices, GLenum(GL_STATIC_DRAW))
Read More:
- OpenGL basic graphics programming – OpenGL and 3D graphics world
- VC + + OpenGL is used as the development platform to design the program, which can generate any pixel on the screen, and use the pixel to draw the basic graphics
- OpenGL learning notes and other learning thinking
- Graphics rendering pipeline diagram of OpenGL
- OpenGL learning — problems encountered in compiling OpenGL program for the first time
- Split screen display method in IntelliJ idea
- 076_ OpenGL graphics program development practice
- Learning notes of OpenGL — blending
- When IntelliJ idea is programmed, 1. Black thick line or black cursor appears; 2. The solution of carriage return unable to wrap. (practical recommendation method 2)
- [181124] VC + + use OpenGL to draw 3D graphics example source code
- OpenGL learning notes: Problems and Solutions
- OpenGL result white screen solution
- Learning from OpenGL
- OpenGL learning summary (1)
- Learning notes — opengl01
- Some pitfalls in OpenGL learning
- Solution of flash screen caused by OpenGL in MFC environment
- Record the problems encountered in OpenGL learning
- Problems and solutions in learning opengl
- Some problems and solutions in learning opengl in vs2017