Skip to content

Commit

Permalink
Fixed some formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-chochlik committed Jun 15, 2015
1 parent addd2f6 commit e33819f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 31 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ Acknowledgements
- *Jesús Zazueta* for useful feedback and help with the fixing of several bugs.
- *Konstantin Gainullin* for porting to Marmalade and fixing several warnings.
- *Peter Laufenberg* for several patches.
- *Jan P Springer (regnirpsj)* for contributing SSBO wrappers and example.
License
=======

Expand Down
38 changes: 20 additions & 18 deletions example/oglplus/014_multi_cube_ssbo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class CubeExample : public Example
// VBOs for the cube's vertices and the uniform block
Buffer verts, block_buf;

//
static unsigned const max_cubes = 54;
//
static unsigned const max_cubes = 54;

public:
CubeExample(void)
: cube_instr(make_cube.Instructions())
Expand All @@ -68,8 +68,8 @@ class CubeExample : public Example
"void main(void)"
"{"
" mat4 ModelMatrix = gl_InstanceID < ModelMatrices.length() ? "
" ModelMatrices[gl_InstanceID] : "
" mat4(1.0);"
" ModelMatrices[gl_InstanceID] : "
" mat4(1.0);"
" gl_Position = "
" ProjectionMatrix *"
" CameraMatrix *"
Expand Down Expand Up @@ -114,7 +114,7 @@ class CubeExample : public Example
(prog|"Position").Setup<GLfloat>(n_per_vertex).Enable();
}

// make the matrices
// make the matrices
{
// nr_cubes x 4x4 matrices
std::vector<GLfloat> matrix_data(max_cubes*16);
Expand Down Expand Up @@ -155,7 +155,7 @@ class CubeExample : public Example
);
block_buf.BindBaseShaderStorage(0);
}

//
gl.ClearColor(0.9f, 0.9f, 0.9f, 0.0f);
gl.ClearDepth(1.0f);
Expand Down Expand Up @@ -189,20 +189,22 @@ class CubeExample : public Example
)
);

static signed cubes (0);
static signed incr (-1);
static double time_last(time);
static signed cubes (0);
static signed incr (-1);
static double time_last(time);


if (0.05 < (time - time_last)) {
if ((max_cubes < cubes) || (1 > cubes)) {
incr *= -1;
}
if (0.05 < (time - time_last))
{
if ((max_cubes < cubes) || (1 > cubes))
{
incr *= -1;
}

cubes += incr;
time_last = time;
}

cubes += incr;
time_last = time;
}

// draw 'cubes' instances of the cube
// the vertex shader will take care of their placement
cube_instr.Draw(cube_indices, cubes);
Expand Down
4 changes: 2 additions & 2 deletions include/oglplus/fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author Matus Chochlik
*
* Copyright 2010-2014 Matus Chochlik. Distributed under the Boost
* Copyright 2010-2015 Matus Chochlik. Distributed under the Boost
* Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
Expand Down Expand Up @@ -199,7 +199,7 @@ typedef ProgVarLoc<tag::Subroutine> SubroutineLoc;
typedef ProgVarLoc<tag::SubroutineUniform> SubroutineUniformLoc;
typedef ProgVarLoc<tag::FragData> FragDataLoc;
typedef ProgVarLoc<tag::ShaderStorageBlock> ShaderStorageBlockLoc;

template <typename VarTag>
class ProgVarLocOps;

Expand Down
12 changes: 6 additions & 6 deletions include/oglplus/shader_storage_block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class ProgVarLocOps<tag::ShaderStorageBlock>
bool active_only
)
{
GLuint result = OGLPLUS_GLFUNC(GetProgramResourceIndex)(
GetGLName(program),
GL_SHADER_STORAGE_BLOCK,
identifier.c_str()
);
GLuint result = OGLPLUS_GLFUNC(GetProgramResourceIndex)(
GetGLName(program),
GL_SHADER_STORAGE_BLOCK,
identifier.c_str()
);
OGLPLUS_CHECK(
GetProgramResourceIndex,
ProgVarError,
Expand All @@ -70,7 +70,7 @@ class ProgVarLocOps<tag::ShaderStorageBlock>
ProgVarError,
Program(program).
Identifier(identifier)
);
);

if(result == GL_INVALID_INDEX)
{
Expand Down
10 changes: 5 additions & 5 deletions include/oglplus/uniform_block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class ProgVarLocOps<tag::UniformBlock>
bool active_only
)
{
GLuint result = OGLPLUS_GLFUNC(GetProgramResourceIndex)(
GetGLName(program),
GL_UNIFORM_BLOCK,
identifier.c_str()
);
GLuint result = OGLPLUS_GLFUNC(GetProgramResourceIndex)(
GetGLName(program),
GL_UNIFORM_BLOCK,
identifier.c_str()
);
OGLPLUS_CHECK(
GetProgramResourceIndex,
ProgVarError,
Expand Down

0 comments on commit e33819f

Please sign in to comment.