Loading...
Searching...
No Matches
VertexBuffer.h
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2024 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#pragma once
26
28// Headers
31
35
36#include <stddef.h>
37
38
56
73
83
91
101
135 const sfVertex* vertices,
136 unsigned int vertexCount,
137 unsigned int offset);
138
149
158
170
184
194
212
222
245
#define CSFML_GRAPHICS_API
struct sfVertexBuffer sfVertexBuffer
sfPrimitiveType
Types of primitives that an sfVertexArray can render.
bool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer *vertexBuffer, const sfVertexBuffer *other)
Copy the contents of another buffer into this buffer.
bool sfVertexBuffer_update(sfVertexBuffer *vertexBuffer, const sfVertex *vertices, unsigned int vertexCount, unsigned int offset)
Update a part of the buffer from an array of vertices.
bool sfVertexBuffer_isAvailable(void)
Tell whether or not the system supports vertex buffers.
sfVertexBufferUsage
Usage specifiers.
@ sfVertexBufferStatic
Rarely changing data.
@ sfVertexBufferStream
Constantly changing data.
@ sfVertexBufferDynamic
Occasionally changing data.
size_t sfVertexBuffer_getVertexCount(const sfVertexBuffer *vertexBuffer)
Return the vertex count.
void sfVertexBuffer_swap(sfVertexBuffer *left, sfVertexBuffer *right)
Swap the contents of this vertex buffer with those of another.
unsigned int sfVertexBuffer_getNativeHandle(const sfVertexBuffer *vertexBuffer)
Get the underlying OpenGL handle of the vertex buffer.
void sfVertexBuffer_destroy(const sfVertexBuffer *vertexBuffer)
Destroy an existing vertex buffer.
sfVertexBufferUsage sfVertexBuffer_getUsage(const sfVertexBuffer *vertexBuffer)
Get the usage specifier of this vertex buffer.
void sfVertexBuffer_bind(const sfVertexBuffer *vertexBuffer)
Bind a vertex buffer for rendering.
sfVertexBuffer * sfVertexBuffer_copy(const sfVertexBuffer *vertexBuffer)
Copy an existing vertex buffer.
void sfVertexBuffer_setPrimitiveType(sfVertexBuffer *vertexBuffer, sfPrimitiveType type)
Set the type of primitives to draw.
void sfVertexBuffer_setUsage(sfVertexBuffer *vertexBuffer, sfVertexBufferUsage usage)
Set the usage specifier of this vertex buffer.
sfPrimitiveType sfVertexBuffer_getPrimitiveType(const sfVertexBuffer *vertexBuffer)
Get the type of primitives drawn by the vertex buffer.
sfVertexBuffer * sfVertexBuffer_create(size_t vertexCount, sfPrimitiveType type, sfVertexBufferUsage usage)
Create a new vertex buffer with a specific sfPrimitiveType and usage specifier.
Define a point with color and texture coordinates.
Definition Vertex.h:40