Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
3132690c
Commit
3132690c
authored
Sep 13, 2014
by
Paulo Henrique Silva
Committed by
Maciej Suminski
Sep 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix slow opengl canvas on Mac OS 10.9.
parent
12472644
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
gpu_manager.cpp
common/gal/opengl/gpu_manager.cpp
+7
-1
gpu_manager.h
include/gal/opengl/gpu_manager.h
+3
-0
No files found.
common/gal/opengl/gpu_manager.cpp
View file @
3132690c
...
@@ -94,6 +94,7 @@ GPU_CACHED_MANAGER::~GPU_CACHED_MANAGER()
...
@@ -94,6 +94,7 @@ GPU_CACHED_MANAGER::~GPU_CACHED_MANAGER()
{
{
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
glDeleteBuffers
(
1
,
&
m_verticesBuffer
);
glDeleteBuffers
(
1
,
&
m_verticesBuffer
);
glDeleteBuffers
(
1
,
&
m_indicesBuffer
);
}
}
}
}
...
@@ -105,6 +106,7 @@ void GPU_CACHED_MANAGER::Initialize()
...
@@ -105,6 +106,7 @@ void GPU_CACHED_MANAGER::Initialize()
if
(
!
m_buffersInitialized
)
if
(
!
m_buffersInitialized
)
{
{
glGenBuffers
(
1
,
&
m_verticesBuffer
);
glGenBuffers
(
1
,
&
m_verticesBuffer
);
glGenBuffers
(
1
,
&
m_indicesBuffer
);
m_buffersInitialized
=
true
;
m_buffersInitialized
=
true
;
}
}
}
}
...
@@ -167,9 +169,13 @@ void GPU_CACHED_MANAGER::EndDrawing()
...
@@ -167,9 +169,13 @@ void GPU_CACHED_MANAGER::EndDrawing()
VertexSize
,
(
GLvoid
*
)
ShaderOffset
);
VertexSize
,
(
GLvoid
*
)
ShaderOffset
);
}
}
glDrawElements
(
GL_TRIANGLES
,
m_indicesSize
,
GL_UNSIGNED_INT
,
(
GLvoid
*
)
m_indices
.
get
()
);
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
m_indicesBuffer
);
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
m_indicesSize
*
sizeof
(
int
),
(
GLvoid
*
)
m_indices
.
get
(),
GL_DYNAMIC_DRAW
);
glDrawElements
(
GL_TRIANGLES
,
m_indicesSize
,
GL_UNSIGNED_INT
,
0
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
0
);
// Deactivate vertex array
// Deactivate vertex array
glDisableClientState
(
GL_COLOR_ARRAY
);
glDisableClientState
(
GL_COLOR_ARRAY
);
...
...
include/gal/opengl/gpu_manager.h
View file @
3132690c
...
@@ -144,6 +144,9 @@ protected:
...
@@ -144,6 +144,9 @@ protected:
///> Handle to vertices buffer
///> Handle to vertices buffer
GLuint
m_verticesBuffer
;
GLuint
m_verticesBuffer
;
///> Handle to indices buffer
GLuint
m_indicesBuffer
;
///> Number of indices stored in the indices buffer
///> Number of indices stored in the indices buffer
unsigned
int
m_indicesSize
;
unsigned
int
m_indicesSize
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment