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
fef47b0b
Commit
fef47b0b
authored
Jul 16, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed OpenGL tracks transparency & netnames issue.
parent
7739cfef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
opengl_gal.cpp
common/gal/opengl/opengl_gal.cpp
+18
-19
No files found.
common/gal/opengl/opengl_gal.cpp
View file @
fef47b0b
...
...
@@ -501,25 +501,6 @@ void OPENGL_GAL::EndDrawing()
glEnableClientState
(
GL_VERTEX_ARRAY
);
glEnableClientState
(
GL_COLOR_ARRAY
);
// Bind vertices data buffers
glBindBuffer
(
GL_ARRAY_BUFFER
,
cachedVerts
);
glVertexPointer
(
VBO_ITEM
::
CoordStride
,
GL_FLOAT
,
VBO_ITEM
::
VertByteSize
,
0
);
glColorPointer
(
VBO_ITEM
::
ColorStride
,
GL_UNSIGNED_BYTE
,
VBO_ITEM
::
VertByteSize
,
(
GLvoid
*
)
VBO_ITEM
::
ColorByteOffset
);
// Shader parameters
if
(
isUseShader
)
{
shader
.
Use
();
glEnableVertexAttribArray
(
shaderAttrib
);
glVertexAttribPointer
(
shaderAttrib
,
VBO_ITEM
::
ShaderStride
,
GL_FLOAT
,
GL_FALSE
,
VBO_ITEM
::
VertByteSize
,
(
GLvoid
*
)
VBO_ITEM
::
ShaderByteOffset
);
}
glDrawElements
(
GL_TRIANGLES
,
indicesSize
,
GL_UNSIGNED_INT
,
(
GLvoid
*
)
0
);
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
0
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
// Draw non-cached items
GLfloat
*
vertices
=
(
GLfloat
*
)(
nonCachedVbo
.
GetAllVertices
()
);
GLubyte
*
colors
=
(
GLubyte
*
)(
nonCachedVbo
.
GetAllVertices
()
)
+
VBO_ITEM
::
ColorOffset
;
...
...
@@ -529,11 +510,29 @@ void OPENGL_GAL::EndDrawing()
glColorPointer
(
VBO_ITEM
::
ColorStride
,
GL_UNSIGNED_BYTE
,
VBO_ITEM
::
VertByteSize
,
colors
);
if
(
isUseShader
)
{
shader
.
Use
();
glEnableVertexAttribArray
(
shaderAttrib
);
glVertexAttribPointer
(
shaderAttrib
,
VBO_ITEM
::
ShaderStride
,
GL_FLOAT
,
GL_FALSE
,
VBO_ITEM
::
VertByteSize
,
shaders
);
}
glDrawArrays
(
GL_TRIANGLES
,
nonCachedItem
->
GetOffset
(),
nonCachedItem
->
GetSize
()
);
// Draw cached items
glBindBuffer
(
GL_ARRAY_BUFFER
,
cachedVerts
);
glVertexPointer
(
VBO_ITEM
::
CoordStride
,
GL_FLOAT
,
VBO_ITEM
::
VertByteSize
,
0
);
glColorPointer
(
VBO_ITEM
::
ColorStride
,
GL_UNSIGNED_BYTE
,
VBO_ITEM
::
VertByteSize
,
(
GLvoid
*
)
VBO_ITEM
::
ColorByteOffset
);
if
(
isUseShader
)
{
glVertexAttribPointer
(
shaderAttrib
,
VBO_ITEM
::
ShaderStride
,
GL_FLOAT
,
GL_FALSE
,
VBO_ITEM
::
VertByteSize
,
(
GLvoid
*
)
VBO_ITEM
::
ShaderByteOffset
);
}
glDrawElements
(
GL_TRIANGLES
,
indicesSize
,
GL_UNSIGNED_INT
,
(
GLvoid
*
)
0
);
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
0
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
// Deactivate vertex array
glDisableClientState
(
GL_COLOR_ARRAY
);
glDisableClientState
(
GL_VERTEX_ARRAY
);
...
...
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