Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions project/ArrayTexture/ArrayTexture.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions project/MultidrawIndirect/MultidrawIndirect.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions project/PersistentMappedBuffer/PersistentMappedBuffer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions project/StandardMappedBuffer/StandardMappedBuffer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
22 changes: 16 additions & 6 deletions src/PersistentMappedBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ namespace

struct Range
{
size_t begin = 0;
GLsync sync = 0;
size_t begin;
GLsync sync;
Range()
: begin(0), sync(0)
{ ; }
};

const GLchar* gVertexShaderSource[] = {
Expand Down Expand Up @@ -128,9 +131,16 @@ void PrepareReferenceTriangles(SVertex2D *trianglePos, size_t triangleCount)
float py = ((float)rand() / (float)RAND_MAX)*1.9f - 0.95f;
float pd = 0.02f;// ((float)rand() / (float)RAND_MAX)*0.02f + 0.01f;

trianglePos[i * 3 + 0] = { px, py + pd };
trianglePos[i * 3 + 1] = { px - pd, py - pd };
trianglePos[i * 3 + 2] = { px + pd, py - pd };
trianglePos[i * 3 + 0].x = px;
trianglePos[i * 3 + 0].y = py + pd;
trianglePos[i * 3 + 1].x = px - pd;
trianglePos[i * 3 + 1].y = py - pd;
trianglePos[i * 3 + 2].x = px + pd;
trianglePos[i * 3 + 2].y = py - pd;

//trianglePos[i * 3 + 0] = { px, py + pd };
//trianglePos[i * 3 + 1] = { px - pd, py - pd };
//trianglePos[i * 3 + 2] = { px + pd, py - pd };
}
}

Expand Down Expand Up @@ -221,7 +231,7 @@ void Init(void)
PrepareReferenceTriangles(gReferenceTrianglePosition.get(), gParamTriangleCount);

//Create an immutable data store for the buffer
size_t bufferSize{ gParamTriangleCount * 3 * sizeof(SVertex2D)};
size_t bufferSize( gParamTriangleCount * 3 * sizeof(SVertex2D));
if (gParamBufferCount > 1)
{
bufferSize *= gParamBufferCount;
Expand Down
13 changes: 8 additions & 5 deletions src/StandardMappedBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ void PrepareReferenceTriangles(SVertex2D *trianglePos, size_t triangleCount)
float py = ((float)rand() / (float)RAND_MAX)*1.9f - 0.95f;
float pd = 0.02f;// ((float)rand() / (float)RAND_MAX)*0.02f + 0.01f;

trianglePos[i * 3 + 0] = { px, py + pd };
trianglePos[i * 3 + 1] = { px - pd, py - pd };
trianglePos[i * 3 + 2] = { px + pd, py - pd };
trianglePos[i * 3 + 0].x = px;
trianglePos[i * 3 + 0].y = py + pd;
trianglePos[i * 3 + 1].x = px - pd;
trianglePos[i * 3 + 1].y = py - pd;
trianglePos[i * 3 + 2].x = px + pd;
trianglePos[i * 3 + 2].y = py - pd;
}
}

Expand Down Expand Up @@ -204,7 +207,7 @@ void Init(void)
PrepareReferenceTriangles(gReferenceTrianglePosition.get(), gParamTriangleCount);

//Create an immutable data store for the buffer
const size_t bufferSize{ gParamTriangleCount * 3 * sizeof(SVertex2D)};
const size_t bufferSize( gParamTriangleCount * 3 * sizeof(SVertex2D));

glBufferData(GL_ARRAY_BUFFER, bufferSize, nullptr, GL_STREAM_DRAW);

Expand Down Expand Up @@ -233,7 +236,7 @@ void Display()
glClear(GL_COLOR_BUFFER_BIT);
gAngle += 0.001f;

const size_t bufferSize{ gParamTriangleCount * 3 * sizeof(SVertex2D) };
const size_t bufferSize( gParamTriangleCount * 3 * sizeof(SVertex2D) );

if (gParamUseMapBuffer)
{
Expand Down