|
|
|
|
@ -28,6 +28,7 @@
|
|
|
|
|
* @brief Function @ref Magnum::MeshTools::fullScreenTriangle() |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#include <memory> |
|
|
|
|
#include <utility> |
|
|
|
|
|
|
|
|
|
#include "Magnum.h" |
|
|
|
|
@ -49,11 +50,11 @@ computed from them. The vertex positions are, in order:
|
|
|
|
|
\begin{pmatrix} 3 \\ 1 \end{pmatrix} |
|
|
|
|
@f] |
|
|
|
|
|
|
|
|
|
On OpenGL 2.1 and OpenGL ES 2.0 the vertex positions are passed explicitly as |
|
|
|
|
attribute `0`, contained in the buffer. On OpenGL 3.0+ and OpenGL ES 3.0+ the |
|
|
|
|
mesh is attribute-less and the vertex positions can be computed using |
|
|
|
|
`gl_VertexID` builtin shader variable, thus `nullptr` is returned instead of |
|
|
|
|
vertex buffer. |
|
|
|
|
Based on @p version parameter, on OpenGL 2.1 and OpenGL ES 2.0 the vertex |
|
|
|
|
positions are passed explicitly as attribute `0`, contained in the buffer. On |
|
|
|
|
OpenGL 3.0+ and OpenGL ES 3.0+ the mesh is attribute-less and the vertex |
|
|
|
|
positions can be computed using `gl_VertexID` builtin shader variable, thus |
|
|
|
|
`nullptr` is returned instead of vertex buffer. |
|
|
|
|
|
|
|
|
|
Computing positions in vertex shader in a portable way might be done like this. |
|
|
|
|
For OpenGL 2.1 and OpenGL ES 2.0 you then need to bind the location of `position` |
|
|
|
|
@ -76,11 +77,15 @@ void main() {
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
@endcode |
|
|
|
|
*/ |
|
|
|
|
std::pair<std::unique_ptr<Buffer>, Mesh> MAGNUM_MESHTOOLS_EXPORT fullScreenTriangle(Version version); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@overload |
|
|
|
|
|
|
|
|
|
@attention The implementation needs to check OpenGL version, so it expects |
|
|
|
|
active context. |
|
|
|
|
This function implicitly uses current context version. |
|
|
|
|
*/ |
|
|
|
|
std::pair<Buffer*, Mesh> MAGNUM_MESHTOOLS_EXPORT fullScreenTriangle(); |
|
|
|
|
std::pair<std::unique_ptr<Buffer>, Mesh> MAGNUM_MESHTOOLS_EXPORT fullScreenTriangle(); |
|
|
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
|
|
|