summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/23-vectordisplay
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/23-vectordisplay')
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/main.cpp17
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/makefile2
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp24
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h10
4 files changed, 26 insertions, 27 deletions
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
index badeeccff9a..cb72564d19f 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
+++ b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
@@ -22,23 +22,23 @@ struct PosColorVertex
static void init()
{
- ms_decl
+ ms_layout
.begin()
.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
.add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
.end();
}
- static bgfx::VertexDecl ms_decl;
+ static bgfx::VertexLayout ms_layout;
};
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_layout;
class ExampleVectorDisplay : public entry::AppI
{
public:
- ExampleVectorDisplay(const char* _name, const char* _description)
- : entry::AppI(_name, _description)
+ ExampleVectorDisplay(const char* _name, const char* _description, const char* _url)
+ : entry::AppI(_name, _description, _url)
{
}
@@ -218,4 +218,9 @@ public:
} // namespace
-ENTRY_IMPLEMENT_MAIN(ExampleVectorDisplay, "23-vectordisplay", "Rendering lines as oldschool vectors.");
+ENTRY_IMPLEMENT_MAIN(
+ ExampleVectorDisplay
+ , "23-vectordisplay"
+ , "Rendering lines as oldschool vectors."
+ , "https://bkaradzic.github.io/bgfx/examples.html#vectordisplay"
+ );
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/makefile b/3rdparty/bgfx/examples/23-vectordisplay/makefile
index 171709170a4..ef9203197d7 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/makefile
+++ b/3rdparty/bgfx/examples/23-vectordisplay/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2018 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2019 Branimir Karadzic. All rights reserved.
# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
#
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
index e63d156b966..7bface50c0d 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
+++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
@@ -1,14 +1,14 @@
/*
* Copyright 2014 Kai Jourdan. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- *
- * Based on code from Brian Luczkiewicz
- * https://github.com/blucz/Vector
- *
- * Uses the SIMPLEX-Font which is a variant of the Hershey font (public domain)
- * http://paulbourke.net/dataformats/hershey/
*/
+// Reference(s):
+// - Based on code from Brian Luczkiewicz
+// https://github.com/blucz/Vector
+// - Uses the SIMPLEX-Font which is a variant of the Hershey font (public domain)
+// https://web.archive.org/web/20120313001837/http://paulbourke.net/dataformats/hershey/
+//
#include <float.h> // FLT_EPSILON
#include <alloca.h> // alloca
@@ -35,7 +35,7 @@ const int HALF_TEXTURE_SIZE = TEXTURE_SIZE / 2;
void PosColorUvVertex::init()
{
- ms_decl
+ ms_layout
.begin()
.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
.add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
@@ -43,7 +43,7 @@ void PosColorUvVertex::init()
.end();
}
-bgfx::VertexDecl PosColorUvVertex::ms_decl;
+bgfx::VertexLayout PosColorUvVertex::ms_layout;
inline float normalizef(float _a)
{
@@ -94,7 +94,7 @@ void VectorDisplay::setup(uint16_t _width, uint16_t _height, uint8_t _view)
m_blitShader = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_blit");
u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
- s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler);
genLinetex();
@@ -737,7 +737,7 @@ bool VectorDisplay::setDecaySteps(int _steps)
for (int i = 0; i < m_numberDecaySteps; ++i)
{
- m_vertexBuffers.push_back(bgfx::createDynamicVertexBuffer(MAX_NUMBER_VERTICES, PosColorUvVertex::ms_decl) );
+ m_vertexBuffers.push_back(bgfx::createDynamicVertexBuffer(MAX_NUMBER_VERTICES, PosColorUvVertex::ms_layout) );
m_vertexBuffersSize.push_back(0);
}
@@ -769,10 +769,10 @@ void VectorDisplay::getSize(float* _outWidth, float* _outHeight)
void VectorDisplay::screenSpaceQuad(float _textureWidth, float _textureHeight, float _width, float _height)
{
- if (3 == getAvailTransientVertexBuffer(3, PosColorUvVertex::ms_decl) )
+ if (3 == getAvailTransientVertexBuffer(3, PosColorUvVertex::ms_layout) )
{
bgfx::TransientVertexBuffer vb;
- bgfx::allocTransientVertexBuffer(&vb, 3, PosColorUvVertex::ms_decl);
+ bgfx::allocTransientVertexBuffer(&vb, 3, PosColorUvVertex::ms_layout);
PosColorUvVertex* vertex = (PosColorUvVertex*)vb.data;
const float zz = 0.0f;
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
index 3dfe15732d9..3b208b01978 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
+++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
@@ -1,12 +1,6 @@
/*
* Copyright 2014 Kai Jourdan. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- *
- * Based on code from Brian Luczkiewicz
- * https://github.com/blucz/Vector
- *
- * Uses the SIMPLEX-Font which is a variant of the Hershey font (public domain)
- * http://paulbourke.net/dataformats/hershey/
*/
#ifndef __VECTORDISPLAY_H__
@@ -28,7 +22,7 @@ struct PosColorUvVertex
uint32_t m_abgr;
static void init();
- static bgfx::VertexDecl ms_decl;
+ static bgfx::VertexLayout ms_layout;
};
class VectorDisplay
@@ -41,7 +35,7 @@ public:
}
void init(bool _originBottomLeft, float _texelHalf);
-
+
void setup(uint16_t _width, uint16_t _height, uint8_t _view = 2);
void resize(uint16_t _width, uint16_t _height);
void teardown();