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:
- Drawing a cube with OpenGL
- Drawing cube with OpenGL
- On the configuration of OpenGL Red Book eighth edition environment in vs2013
- Vs2015 configuring OpenGL (glfw, glew)
- XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
- OpenGL learning notes and other learning thinking
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- Graphics rendering pipeline diagram of OpenGL
- Numpy adds a new dimension: newaxis
- Error of reading character c + +
- Matlab realization of user-defined curve and legend
- Mysql cannot allocate memory for the buffer pool solution
- An example of drawing rotating cube with OpenGL
- Common problems of shadow map in OpenGL
- SFINAE of C++ idioms
- Common problems and basic concept knowledge of OpenGL
- What is cs0120 error
- (springmvc) Failed to load resource: the server responded with a status of 404 (Not Found)
- MFC flash screen solution
- ‘builtin_ function_ or_ Method ‘object is not subscriptable error