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")
,
}
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 point in physical 3D space.
Definition elementary/eagle/PhysicalSpace.hpp:106
Base class for objects that implement a drawing routine using OpenGL.
Definition VGLRenderObject.hpp:20
Request structure.
Definition VRequest.hpp:24
DomainVector< Vector< color8_t, 3 >, RGB > rgb_t
8 bit RGB colors
Definition ColorSpace.hpp:199
StrongPtr< Object, ObjectBase > RefPtr
Convenience template typedef to use RefPtr instead of StrongPtr.
Definition RefPtr.hpp:776
The Panthalassa namespace allows to conveniently specify the properties of a VCreator object during c...
Definition VCreatorProperties.hpp:385
Wizt::VCreatorProperty< Wizt::VCreatorProperties::DESCRIPTION > Description
Possibly complex description via UTF8 codes.
Definition VCreatorProperties.hpp:396
Wizt::VCreatorProperty< Wizt::VCreatorProperties::CATEGORY > Category
Classification, such as Display or Computer or Demo.
Definition VCreatorProperties.hpp:390
The Vish namespace.
Definition Anemone.cpp:17
@ DEFAULT_OBJECT
Usual objects shall be assigned a priority number around zero.
Definition RenderCategory.hpp:81
@ DEMO
This object is only for demonstration purposes, but not necessarily providing enduser functionality.
Definition ObjectQuality.hpp:34
A special vish context that is passed to VGLRenderObjects when rendering.
Definition VGLRenderContext.hpp:35
Implements a data sink.
Definition VPipeline.hpp:73