Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
d256bd81
Commit
d256bd81
authored
Aug 24, 2012
by
Robert Menzel
Browse files
reduced warnings, added GL 4.3 define, added compute shaders to shader filetype detection
parent
4229a2e0
Changes
7
Hide whitespace changes
Inline
Side-by-side
include/ACGL/OpenGL/Controller/ShaderProgramControlFiles.hh
View file @
d256bd81
...
...
@@ -82,7 +82,7 @@ public:
inline
ShaderProgramControlFiles
&
andFile
(
const
std
::
string
&
_fileName
)
{
addFile
(
_fileName
);
mShaderType
.
push_back
(
GL_INVALID_VALUE
);
return
*
this
;
}
//! adds a single file, the shader type is explicitly given and must be one of:
//! GL_VERTEX_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER, GL_FRAGMENT_SHADER
//! GL_VERTEX_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER, GL_FRAGMENT_SHADER
, GL_COMPUTE_SHADER
inline
ShaderProgramControlFiles
&
andFile
(
const
std
::
string
&
_fileName
,
GLenum
_type
)
{
addFile
(
_fileName
);
mShaderType
.
push_back
(
_type
);
return
*
this
;
}
//! adds all files begining with the given name, the shader type will be guessed by the ending:
...
...
include/ACGL/OpenGL/GL.hh
View file @
d256bd81
...
...
@@ -54,6 +54,8 @@
# define ACGL_OPENGL_VERSION 41
#elif defined (ACGL_OPENGL_VERSION_42)
# define ACGL_OPENGL_VERSION 42
#elif defined (ACGL_OPENGL_VERSION_43)
# define ACGL_OPENGL_VERSION 43
#else
// failback:
#warning "NO ACGL_OPENGL_VERSION_XY SET! Default to 3.2"
...
...
src/ACGL/OpenGL/Controller/GeometryDataControlFileATB.cc
View file @
d256bd81
...
...
@@ -157,7 +157,7 @@ bool GeometryDataControlFileATB::load(SharedGeometryData& _geometry) const
std
::
memcpy
(
data
,
&
dataVector
[
0
],
dataVector
.
size
()
*
sizeof
(
GLfloat
));
// Name the attribute according to the filename
ArrayBuffer
::
Attribute
attr
=
{
mAttributeName
,
GL_FLOAT
,
attributeDimension
,
0
,
GL_FALSE
,
0
};
ArrayBuffer
::
Attribute
attr
=
{
mAttributeName
,
GL_FLOAT
,
attributeDimension
,
0
,
GL_FALSE
,
0
,
GL_FALSE
};
_geometry
->
mAttributes
.
push_back
(
attr
);
// Tell the _geometry object where it finds the data
...
...
src/ACGL/OpenGL/Controller/GeometryDataControlFileOBJ.cc
View file @
d256bd81
...
...
@@ -280,18 +280,18 @@ bool GeometryDataControlFileOBJ::load(SharedGeometryData& geometry) const
geometry
->
setData
(
(
GLubyte
*
)
data
);
geometry
->
setStrideSize
(
components
*
sizeof
(
float
)
);
ArrayBuffer
::
Attribute
apos
=
{
"aPosition"
,
GL_FLOAT
,
4
,
0
,
GL_FALSE
,
0
};
ArrayBuffer
::
Attribute
apos
=
{
"aPosition"
,
GL_FLOAT
,
4
,
0
,
GL_FALSE
,
0
,
GL_FALSE
};
geometry
->
mAttributes
.
push_back
(
apos
);
if
(
hasNormals
)
{
ArrayBuffer
::
Attribute
anorm
=
{
"aNormal"
,
GL_FLOAT
,
3
,
4
*
sizeof
(
float
),
GL_FALSE
,
0
};
ArrayBuffer
::
Attribute
anorm
=
{
"aNormal"
,
GL_FLOAT
,
3
,
4
*
sizeof
(
float
),
GL_FALSE
,
0
,
GL_FALSE
};
geometry
->
mAttributes
.
push_back
(
anorm
);
}
if
(
texCoordDimension
>
0
)
{
int
offset
=
(
hasNormals
?
7
:
4
);
offset
*=
sizeof
(
float
);
ArrayBuffer
::
Attribute
atex
=
{
"aTexCoord"
,
GL_FLOAT
,
texCoordDimension
,
offset
,
GL_FALSE
,
0
};
ArrayBuffer
::
Attribute
atex
=
{
"aTexCoord"
,
GL_FLOAT
,
texCoordDimension
,
offset
,
GL_FALSE
,
0
,
GL_FALSE
};
geometry
->
mAttributes
.
push_back
(
atex
);
}
...
...
src/ACGL/OpenGL/Controller/ShaderControlFile.cc
View file @
d256bd81
...
...
@@ -23,14 +23,22 @@ SharedShader ShaderControlFile::create(void)
if
(
extension
==
"vsh"
)
mType
=
GL_VERTEX_SHADER
;
else
if
(
extension
==
"fsh"
)
mType
=
GL_FRAGMENT_SHADER
;
#if (ACGL_OPENGL_VERSION >= 43)
else
if
(
extension
==
"csh"
)
mType
=
GL_COMPUTE_SHADER
;
#endif
#if (ACGL_OPENGL_VERSION >= 40)
else
if
(
extension
==
"tcsh"
)
mType
=
GL_TESS_CONTROL_SHADER
;
else
if
(
extension
==
"tesh"
)
mType
=
GL_TESS_EVALUATION_SHADER
;
#endif
#if (ACGL_OPENGL_VERSION >= 32)
else
if
(
extension
==
"gsh"
)
mType
=
GL_GEOMETRY_SHADER
;
else
if
(
extension
==
"fsh"
)
mType
=
GL_FRAGMENT_SHADER
;
#endif
else
return
SharedShader
();
}
...
...
src/ACGL/OpenGL/Controller/ShaderProgramControlFiles.cc
View file @
d256bd81
...
...
@@ -29,6 +29,9 @@ const ShaderProgramControlFiles::ShaderEndings ShaderProgramControlFiles::sShade
{
"tesh"
,
GL_TESS_EVALUATION_SHADER
},
{
"gsh"
,
GL_GEOMETRY_SHADER
},
{
"geo"
,
GL_GEOMETRY_SHADER
},
#if (ACGL_OPENGL_VERSION >= 43)
{
"csh"
,
GL_COMPUTE_SHADER
},
#endif
#endif
{
"vsh"
,
GL_VERTEX_SHADER
},
{
"vert"
,
GL_VERTEX_SHADER
},
...
...
src/ACGL/OpenGL/Objects/FrameBufferObject.cc
View file @
d256bd81
...
...
@@ -93,7 +93,7 @@ bool FrameBufferObject::attachColorAttachment( const Attachment &_attachment )
if
(
mColorAttachments
[
i
].
name
==
_attachment
.
name
)
{
// replace this attachment
GLuint
newLocation
=
_attachment
.
location
;
if
(
newLocation
>
maxColorBuffers
)
{
if
(
newLocation
>
(
GLuint
)
maxColorBuffers
)
{
// we have to find a place, but luckily we can use the old location of the same-named attachment:
newLocation
=
mColorAttachments
[
i
].
location
;
}
...
...
@@ -105,7 +105,7 @@ bool FrameBufferObject::attachColorAttachment( const Attachment &_attachment )
if
(
realLocation
==
-
1
)
{
// it's a new attachment
GLuint
newLocation
=
_attachment
.
location
;
if
(
newLocation
>
maxColorBuffers
)
{
if
(
newLocation
>
(
GLuint
)
maxColorBuffers
)
{
// we have to find a place:
newLocation
=
mColorAttachments
.
size
();
}
...
...
Write
Preview
Supports
Markdown
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