37 : shared_orphan_list_(shared_orphan_list)
43 float data[4] = {0.0f, 0.0f, 0.0f, 1.0f};
46 glBufferData(GL_ARRAY_BUFFER,
sizeof(data), data, GL_STATIC_DRAW);
47 glBindBuffer(GL_ARRAY_BUFFER, 0);
60 if (default_fbo != 0) {
63 glBindFramebuffer(GL_FRAMEBUFFER, default_fbo);
72 GLboolean supports_stereo_quad_buffer = GL_FALSE;
73 glGetBooleanv(GL_STEREO, &supports_stereo_quad_buffer);
74 if (supports_stereo_quad_buffer) {
208void GLContext::orphans_clear()
214 if (!orphaned_vertarrays_.
is_empty()) {
215 glDeleteVertexArrays(
uint(orphaned_vertarrays_.
size()), orphaned_vertarrays_.
data());
216 orphaned_vertarrays_.
clear();
218 if (!orphaned_framebuffers_.
is_empty()) {
219 glDeleteFramebuffers(
uint(orphaned_framebuffers_.
size()), orphaned_framebuffers_.
data());
220 orphaned_framebuffers_.
clear();
222 lists_mutex_.unlock();
227void GLContext::orphans_add(
Vector<GLuint> &orphan_list, std::mutex &list_mutex, GLuint
id)
237 glDeleteVertexArrays(1, &vao_id);
240 orphans_add(orphaned_vertarrays_, lists_mutex_, vao_id);
247 glDeleteFramebuffers(1, &fbo_id);
250 orphans_add(orphaned_framebuffers_, lists_mutex_, fbo_id);
258 glDeleteBuffers(1, &buf_id);
270 glDeleteTextures(1, &tex_id);
291 vao_caches_.add(cache);
292 lists_mutex_.unlock();
298 vao_caches_.remove(cache);
299 lists_mutex_.unlock();
310 if (epoxy_has_gl_extension(
"GL_NVX_gpu_memory_info")) {
312 glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, r_total_mem);
313 glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, r_free_mem);
315 else if (epoxy_has_gl_extension(
"GL_ATI_meminfo")) {
317 glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, stats);
320 *r_free_mem = stats[0];
GHOST C-API function and type declarations.
int32_t GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
int32_t GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
unsigned int GHOST_GetDefaultGPUFramebuffer(GHOST_WindowHandle windowhandle)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void append(const T &value)
StateManager * state_manager
bool is_active_on_thread()
FrameBuffer * front_right
ShaderCompiler * compiler
void size_set(int width, int height)
GLSharedOrphanLists & shared_orphan_list_get()
GLShaderCompiler * get_compiler()
static void buf_free(GLuint buf_id)
uint16_t bound_ssbo_slots
void memory_statistics_get(int *r_total_mem, int *r_free_mem) override
void begin_frame() override
GLContext(void *ghost_window, GLSharedOrphanLists &shared_orphan_list)
void vao_cache_unregister(GLVaoCache *cache)
static void tex_free(GLuint tex_id)
void deactivate() override
void vao_free(GLuint vao_id)
void end_frame() override
void vao_cache_register(GLVaoCache *cache)
void fbo_free(GLuint fbo_id)
Vector< GLuint > textures