Demonstration how to render a very simple geometry in Vish using OpenGL 1 calls.
Demonstration how to render a very simple geometry in Vish using OpenGL 1 calls.
#include <ocean/GLvish/VGLRenderObject.hpp>
#include <ocean/plankton/VPipeline.hpp>
#include <ocean/GLvish/GLTexture.hpp>
namespace
{
{
public:
~QuadDemo();
bool update(
VRequest&R,
double precision)
override;
};
{
}
QuadDemo::~QuadDemo()
{}
{
return true;
}
{
glDisable ( GL_COLOR_MATERIAL );
glDisable ( GL_LIGHTING );
glEnable(GL_TEXTURE_2D);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
const int W = 128, H = 128;
for(int y=0; y<H; y++)
for(int x=0; x<W; x++)
{
Image[x+W*y][0] = 2*x;
Image[x+W*y][1] = 2*y;
Image[x+W*y][2] = x+y;
}
glTexImage2D(GL_TEXTURE_2D, 0, 3, W,H, 0, GL_RGB,
GL_UNSIGNED_BYTE,
Image);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex3f (0,-1,-1);
glTexCoord2f( 0,1);
glVertex3f (0,-1,1);
glTexCoord2f(1,1);
glVertex3f (0,1,1);
glTexCoord2f(1, 0);
glVertex3f (0,1,-1);
glEnd();
return true;
}
/VIdentifier("QuadDemo")
/
Description(
"Display an image in two different coordinate systems")
,
ObjectQuality::DEMO);
}
A coordinate-parallel bounding box in three dimensions.
Definition elementary/aerie/BoundingBox.hpp:24
A set of variable names, with indices associated to each type.
Definition Context.hpp:18
A vector type that is bound to a certain domain, inheriting all vector space properties,...
Definition DomainVector.hpp:23
A point in physical 3D space.
Definition elementary/eagle/PhysicalSpace.hpp:106
A reference counting pointer class which keeps objects alive as long as strong pointers to these obje...
Definition RefPtr.hpp:405
A set of property elements for VCreator objects.
Definition VCreatorProperties.hpp:258
Base class for objects that implement a drawing routine using OpenGL.
Definition VGLRenderObject.hpp:20
Request structure.
Definition VRequest.hpp:24
The Panthalassa namespace allows to conveniently specify the properties of a VCreator object during c...
Definition VCreatorProperties.hpp:385
The Vish namespace.
Definition Anemone.cpp:17
A special vish context that is passed to VGLRenderObjects when rendering.
Definition VGLRenderContext.hpp:35
Implements a data sink.
Definition VPipeline.hpp:73