CSFML - C binding of the Simple and Fast Multimedia Library

CSFML 2.6.1

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

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#ifndef SFML_VERTEXBUFFER_H
26#define SFML_VERTEXBUFFER_H
27
29// Headers
31#include <SFML/Graphics/Export.h>
32#include <SFML/Graphics/PrimitiveType.h>
33#include <SFML/Graphics/Types.h>
34#include <SFML/Graphics/Vertex.h>
35#include <stddef.h>
36
37
49 typedef enum
50{
51 sfVertexBufferStream,
52 sfVertexBufferDynamic,
53 sfVertexBufferStatic
54} sfVertexBufferUsage;
55
71 CSFML_GRAPHICS_API sfVertexBuffer* sfVertexBuffer_create(unsigned int vertexCount, sfPrimitiveType type, sfVertexBufferUsage usage);
72
81 CSFML_GRAPHICS_API sfVertexBuffer* sfVertexBuffer_copy(const sfVertexBuffer* vertexBuffer);
82
89 CSFML_GRAPHICS_API void sfVertexBuffer_destroy(sfVertexBuffer* vertexBuffer);
90
99 CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuffer* vertexBuffer);
100
132 CSFML_GRAPHICS_API sfBool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset);
133
143 CSFML_GRAPHICS_API sfBool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer* vertexBuffer, const sfVertexBuffer* other);
144
152 CSFML_GRAPHICS_API void sfVertexBuffer_swap(sfVertexBuffer* left, sfVertexBuffer* right);
153
164 CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getNativeHandle(sfVertexBuffer* vertexBuffer);
165
178 CSFML_GRAPHICS_API void sfVertexBuffer_setPrimitiveType(sfVertexBuffer* vertexBuffer, sfPrimitiveType type);
179
188 CSFML_GRAPHICS_API sfPrimitiveType sfVertexBuffer_getPrimitiveType(const sfVertexBuffer* vertexBuffer);
189
206 CSFML_GRAPHICS_API void sfVertexBuffer_setUsage(sfVertexBuffer* vertexBuffer, sfVertexBufferUsage usage);
207
216 CSFML_GRAPHICS_API sfVertexBufferUsage sfVertexBuffer_getUsage(const sfVertexBuffer* vertexBuffer);
217
239 CSFML_GRAPHICS_API void sfVertexBuffer_bind(const sfVertexBuffer* vertexBuffer);
240
251 CSFML_GRAPHICS_API sfBool sfVertexBuffer_isAvailable(void);
252
253
254#endif // SFML_VERTEXBUFFER_H
sfBool
int sfBool
Definition Config.h:153
Export.h
CSFML_GRAPHICS_API
#define CSFML_GRAPHICS_API
Definition Graphics/Export.h:43
Types.h
sfVertexBuffer
struct sfVertexBuffer sfVertexBuffer
Definition Graphics/Types.h:43
PrimitiveType.h
sfPrimitiveType
sfPrimitiveType
Types of primitives that a sf::VertexArray can render.
Definition PrimitiveType.h:43
sfVertexBuffer_updateFromVertexBuffer
sfBool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer *vertexBuffer, const sfVertexBuffer *other)
Copy the contents of another buffer into this buffer.
sfVertexBufferUsage
sfVertexBufferUsage
Usage specifiers.
Definition VertexBuffer.h:50
sfVertexBufferStatic
@ sfVertexBufferStatic
Rarely changing data.
Definition VertexBuffer.h:53
sfVertexBufferStream
@ sfVertexBufferStream
Constantly changing data.
Definition VertexBuffer.h:51
sfVertexBufferDynamic
@ sfVertexBufferDynamic
Occasionally changing data.
Definition VertexBuffer.h:52
sfVertexBuffer_swap
void sfVertexBuffer_swap(sfVertexBuffer *left, sfVertexBuffer *right)
Swap the contents of this vertex buffer with those of another.
sfVertexBuffer_update
sfBool sfVertexBuffer_update(sfVertexBuffer *vertexBuffer, const sfVertex *vertices, unsigned int vertexCount, unsigned int offset)
Update a part of the buffer from an array of vertices.
sfVertexBuffer_getNativeHandle
unsigned int sfVertexBuffer_getNativeHandle(sfVertexBuffer *vertexBuffer)
Get the underlying OpenGL handle of the vertex buffer.
sfVertexBuffer_getUsage
sfVertexBufferUsage sfVertexBuffer_getUsage(const sfVertexBuffer *vertexBuffer)
Get the usage specifier of this vertex buffer.
sfVertexBuffer_destroy
void sfVertexBuffer_destroy(sfVertexBuffer *vertexBuffer)
Destroy an existing vertex buffer.
sfVertexBuffer_create
sfVertexBuffer * sfVertexBuffer_create(unsigned int vertexCount, sfPrimitiveType type, sfVertexBufferUsage usage)
Create a new vertex buffer with a specific sfPrimitiveType and usage specifier.
sfVertexBuffer_bind
void sfVertexBuffer_bind(const sfVertexBuffer *vertexBuffer)
Bind a vertex buffer for rendering.
sfVertexBuffer_copy
sfVertexBuffer * sfVertexBuffer_copy(const sfVertexBuffer *vertexBuffer)
Copy an existing vertex buffer.
sfVertexBuffer_setPrimitiveType
void sfVertexBuffer_setPrimitiveType(sfVertexBuffer *vertexBuffer, sfPrimitiveType type)
Set the type of primitives to draw.
sfVertexBuffer_isAvailable
sfBool sfVertexBuffer_isAvailable(void)
Tell whether or not the system supports vertex buffers.
sfVertexBuffer_setUsage
void sfVertexBuffer_setUsage(sfVertexBuffer *vertexBuffer, sfVertexBufferUsage usage)
Set the usage specifier of this vertex buffer.
sfVertexBuffer_getVertexCount
unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuffer *vertexBuffer)
Return the vertex count.
sfVertexBuffer_getPrimitiveType
sfPrimitiveType sfVertexBuffer_getPrimitiveType(const sfVertexBuffer *vertexBuffer)
Get the type of primitives drawn by the vertex buffer.
Vertex.h
sfVertex
Define a point with color and texture coordinates.
Definition Vertex.h:40