本文整理汇总了C++中pie_SetRendMode函数的典型用法代码示例。如果您正苦于以下问题:C++ pie_SetRendMode函数的具体用法?C++ pie_SetRendMode怎么用?C++ pie_SetRendMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pie_SetRendMode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iV_DrawImage2
void iV_DrawImage2(const QString &filename, float x, float y, float width, float height)
{
ImageDef *image = iV_GetImage(filename, x, y);
const GLfloat invTextureSize = image->invTextureSize;
const int tu = image->Tu;
const int tv = image->Tv;
const int w = width > 0 ? width : image->Width;
const int h = height > 0 ? height : image->Height;
x += image->XOffset;
y += image->YOffset;
pie_SetTexturePage(image->textureId);
glColor4ubv(WZCOL_WHITE.vector);
pie_SetRendMode(REND_ALPHA);
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(tu * image->invTextureSize, tv * invTextureSize);
glVertex2f(x, y);
glTexCoord2f((tu + image->Width) * invTextureSize, tv * invTextureSize);
glVertex2f(x + w, y);
glTexCoord2f(tu * invTextureSize, (tv + image->Height) * invTextureSize);
glVertex2f(x, y + h);
glTexCoord2f((tu + image->Width) * invTextureSize, (tv + image->Height) * invTextureSize);
glVertex2f(x + w, y + h);
glEnd();
}
示例2: pie_DrawSkybox
void pie_DrawSkybox(float scale)
{
GL_DEBUG("Drawing skybox");
glPushAttrib(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_FOG_BIT);
// no use in updating the depth buffer
glDepthMask(GL_FALSE);
// fog should not affect the sky
glDisable(GL_FOG);
// So we have realistic colors
glColor4ub(0xFF,0xFF,0xFF,0xFF);
// enable alpha
pie_SetRendMode(REND_ALPHA);
// for the nice blend of the sky with the fog
glDisable(GL_ALPHA_TEST);
// Apply scale matrix
glScalef(scale, scale/2.0f, scale);
skyboxGfx->draw();
glPopAttrib();
}
示例3: pie_Draw3DButton
static void pie_Draw3DButton(iIMDShape *shape)
{
const PIELIGHT colour = WZCOL_WHITE;
const PIELIGHT teamcolour = pal_GetTeamColour(NetPlay.players[selectedPlayer].colour);
pie_SetFogStatus(false);
pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);
pie_ActivateShader(SHADER_BUTTON, shape, teamcolour, colour);
pie_SetRendMode(REND_OPAQUE);
glColor4ubv(colour.vector); // Only need to set once for entire model
pie_SetTexturePage(shape->texpage);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, shape->buffers[VBO_VERTEX]); glVertexPointer(3, GL_FLOAT, 0, NULL);
glBindBuffer(GL_ARRAY_BUFFER, shape->buffers[VBO_NORMAL]); glNormalPointer(GL_FLOAT, 0, NULL);
glBindBuffer(GL_ARRAY_BUFFER, shape->buffers[VBO_TEXCOORD]); glTexCoordPointer(2, GL_FLOAT, 0, NULL);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, shape->buffers[VBO_INDEX]);
glDrawElements(GL_TRIANGLES, shape->npolys * 3, GL_UNSIGNED_SHORT, NULL);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
polyCount += shape->npolys;
pie_DeactivateShader();
pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON);
}
示例4: pie_DrawShadows
static void pie_DrawShadows(void)
{
const float width = pie_GetVideoBufferWidth();
const float height = pie_GetVideoBufferHeight();
pie_SetTexturePage(TEXPAGE_NONE);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthFunc(GL_LESS);
glDepthMask(GL_FALSE);
glEnable(GL_STENCIL_TEST);
ShadowStencilFunc();
glEnable(GL_CULL_FACE);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilMask(~0);
glStencilFunc(GL_LESS, 0, ~0);
glDisable(GL_DEPTH_TEST);
PIELIGHT grey;
grey.byte = { 0, 0, 0, 128 };
pie_BoxFill(0, 0, width, height, grey, REND_ALPHA);
pie_SetRendMode(REND_OPAQUE);
glDisable(GL_STENCIL_TEST);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
scshapes.resize(0);
}
示例5: pie_RenderRadarRotated
void pie_RenderRadarRotated(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y,int angle)
{
PIEIMAGE pieImage;
PIERECT dest;
//special case of pie_ImageDef
switch (pie_GetRenderEngine())
{
case ENGINE_4101:
case ENGINE_SR:
pie_ImageDef(Image,Bmp,Modulus,x,y,FALSE);
break;
case ENGINE_GLIDE:
pie_ImageDef(Image,Bmp,Modulus,x,y,TRUE);
break;
case ENGINE_D3D:
pie_SetBilinear(TRUE);
pie_SetRendMode(REND_GOURAUD_TEX);
pie_SetColour(COLOURINTENSITY);
pie_SetColourKeyedBlack(TRUE);
//special case function because texture is held outside of texture list
pieImage.texPage = RADAR_TEXPAGE_D3D;
pieImage.tu = 0;
pieImage.tv = 0;
pieImage.tw = dtm_GetRadarTexImageSize();
pieImage.th = dtm_GetRadarTexImageSize();
dest.x = x;
dest.y = y;
dest.w = 128;
dest.h = 128;
pie_DrawImage(&pieImage, &dest, &rendStyle);
default:
break;
}
}
示例6: iV_DrawImageRepeatX
// Repeat a texture
void iV_DrawImageRepeatX(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width)
{
int hRep, hRemainder;
assertValidImage(ImageFile, ID);
const ImageDef *Image = &ImageFile->imageDefs[ID];
pie_SetRendMode(REND_OPAQUE);
pie_SetAlphaTest(true);
PIERECT dest;
Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);
hRemainder = Width % Image->Width;
for (hRep = 0; hRep < Width / Image->Width; hRep++)
{
pie_DrawImage(ImageFile, ID, pieImage, &dest);
dest.x += Image->Width;
}
// draw remainder
if (hRemainder > 0)
{
pieImage.x = hRemainder;
dest.w = hRemainder;
pie_DrawImage(ImageFile, ID, pieImage, &dest);
}
}
示例7: pie_Line
void pie_Line(int x0, int y0, int x1, int y1, uint32 colour)
{
PIELIGHT light;
iColour* psPalette;
pie_SetRendMode(REND_FLAT);
pie_SetColour(colour);
pie_SetTexturePage(-1);
switch (pie_GetRenderEngine())
{
case ENGINE_4101:
case ENGINE_SR:
line(x0, y0, x1, y1, colour);
break;
case ENGINE_GLIDE:
gl_Line(x0, y0, x1, y1, colour);
break;
case ENGINE_D3D:
/* Get our colour values from the ivis palette */
psPalette = pie_GetGamePal();
light.byte.r = psPalette[colour].r;
light.byte.g = psPalette[colour].g;
light.byte.b = psPalette[colour].b;
light.byte.a = MAX_UB_LIGHT;
pie_DrawLine(x0, y0, x1, y1, light.argb, TRUE);
default:
break;
}
}
示例8: pie_DrawFogBox
/// Draws a fog colored box which is wider at the top
void pie_DrawFogBox(float left, float right, float front, float back, float height, float wider)
{
PIELIGHT fog_colour = pie_GetFogColour();
pie_SetTexturePage(TEXPAGE_NONE);
glColor4ub(fog_colour.byte.r,fog_colour.byte.g,fog_colour.byte.b,0xFF);
pie_SetRendMode(REND_OPAQUE);
glPushAttrib(GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT | GL_FOG_BIT);
// no use in updating the depth buffer
glDepthMask(GL_FALSE);
glDisable(GL_FOG);
glBegin(GL_QUAD_STRIP);
// Front
glVertex3f(-left, 0, front); // bottom left
glVertex3f(-left-wider, height, front+wider); // top left
glVertex3f( right, 0, front); // bottom right
glVertex3f( right+wider, height, front+wider); // top right
// Right
glVertex3f( right, 0,-back); // bottom r
glVertex3f( right+wider, height,-back-wider); // top r
// Back
glVertex3f(-left, 0, -back); // bottom right
glVertex3f(-left-wider, height, -back-wider); // top right
// Left
glVertex3f(-left, 0, front); // bottom r
glVertex3f(-left-wider, height, front+wider); // top r
glEnd();
glPopAttrib();
}
示例9: pie_DrawViewingWindow
void pie_DrawViewingWindow()
{
SDWORD i;
PIELIGHT colour = pieColour;
pie_SetTexturePage(TEXPAGE_NONE);
pie_SetRendMode(REND_ALPHA);
glColor4ub(colour.byte.r, colour.byte.g, colour.byte.b, colour.byte.a >> 1);
glBegin(GL_TRIANGLE_FAN);
for (i = 0; i < VW_VERTICES; i++)
{
glVertex2f(pieVrts[i].x, pieVrts[i].y);
}
glEnd();
glColor4ub(colour.byte.r, colour.byte.g, colour.byte.b, colour.byte.a);
glBegin(GL_LINE_STRIP);
for (i = 0; i < VW_VERTICES; i++)
{
glVertex2f(pieVrts[i].x, pieVrts[i].y);
}
glVertex2f(pieVrts[0].x, pieVrts[0].y);
glEnd();
}
示例10: iV_DrawImageRepeatY
void iV_DrawImageRepeatY(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Height)
{
int vRep, vRemainder;
assertValidImage(ImageFile, ID);
const ImageDef *Image = &ImageFile->imageDefs[ID];
pie_SetRendMode(REND_OPAQUE);
pie_SetAlphaTest(true);
PIERECT dest;
Vector2i pieImage = makePieImage(ImageFile, ID, &dest, x, y);
vRemainder = Height % Image->Height;
for (vRep = 0; vRep < Height / Image->Height; vRep++)
{
pie_DrawImage(ImageFile, ID, pieImage, &dest);
dest.y += Image->Height;
}
// draw remainder
if (vRemainder > 0)
{
pieImage.y = vRemainder;
dest.h = vRemainder;
pie_DrawImage(ImageFile, ID, pieImage, &dest);
}
}
示例11: iV_ShadowBox
void iV_ShadowBox(int x0, int y0, int x1, int y1, int pad, PIELIGHT first, PIELIGHT second, PIELIGHT fill)
{
pie_SetRendMode(REND_OPAQUE);
pie_SetTexturePage(TEXPAGE_NONE);
pie_DrawRect(x0 + pad, y0 + pad, x1 - pad, y1 - pad, fill);
iV_Box2(x0, y0, x1, y1, first, second);
}
示例12: pie_DrawShadows
static void pie_DrawShadows(void)
{
const float width = pie_GetVideoBufferWidth();
const float height = pie_GetVideoBufferHeight();
pie_SetTexturePage(TEXPAGE_NONE);
glPushMatrix();
pie_SetAlphaTest(false);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthFunc(GL_LESS);
glDepthMask(GL_FALSE);
glEnable(GL_STENCIL_TEST);
ShadowStencilFunc();
pie_SetRendMode(REND_ALPHA);
glEnable(GL_CULL_FACE);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilMask(~0);
glStencilFunc(GL_LESS, 0, ~0);
glColor4f(0, 0, 0, 0.5);
pie_PerspectiveEnd();
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(0, 0);
glVertex2f(width, 0);
glVertex2f(0, height);
glVertex2f(width, height);
glEnd();
pie_PerspectiveBegin();
pie_SetRendMode(REND_OPAQUE);
glDisable(GL_STENCIL_TEST);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glPopMatrix();
scshapes.clear();
}
示例13: drawDecals
static void drawDecals(const glm::mat4 &ModelViewProjection, const glm::vec4 ¶msXLight, const glm::vec4 ¶msYLight, const glm::mat4 &textureMatrix)
{
const auto &renderState = getCurrentRenderState();
const glm::vec4 fogColor(
renderState.fogColour.vector[0] / 255.f,
renderState.fogColour.vector[1] / 255.f,
renderState.fogColour.vector[2] / 255.f,
renderState.fogColour.vector[3] / 255.f
);
const auto &program = pie_ActivateShader(SHADER_DECALS, ModelViewProjection, paramsXLight, paramsYLight, 0, 1, textureMatrix,
renderState.fogEnabled, renderState.fogBegin, renderState.fogEnd, fogColor);
// select the terrain texture page
pie_SetTexturePage(terrainPage);
// use the alpha to blend
pie_SetRendMode(REND_ALPHA);
// and the texture coordinates buffer
decalVBO->bind();
glVertexAttribPointer(program.locVertex, 3, GL_FLOAT, GL_FALSE, sizeof(DecalVertex), BUFFER_OFFSET(0));
glEnableVertexAttribArray(program.locVertex);
glVertexAttribPointer(program.locTexCoord, 2, GL_FLOAT, GL_FALSE, sizeof(DecalVertex), BUFFER_OFFSET(12));
glEnableVertexAttribArray(program.locTexCoord);
glBindBuffer(GL_ARRAY_BUFFER, 0);
int size = 0;
int offset = 0;
for (int x = 0; x < xSectors; x++)
{
for (int y = 0; y < ySectors + 1; y++)
{
if (y < ySectors && offset + size == sectors[x * ySectors + y].decalOffset && sectors[x * ySectors + y].draw)
{
// append
size += sectors[x * ySectors + y].decalSize;
continue;
}
// can't append, so draw what we have and start anew
if (size > 0)
{
glDrawArrays(GL_TRIANGLES, offset, size);
}
size = 0;
if (y < ySectors && sectors[x * ySectors + y].draw)
{
offset = sectors[x * ySectors + y].decalOffset;
size = sectors[x * ySectors + y].decalSize;
}
}
}
glDepthMask(GL_TRUE);
glDisableVertexAttribArray(program.locTexCoord);
glDisableVertexAttribArray(program.locVertex);
pie_DeactivateShader();
}
示例14: painter
// Re-enable when Qt's font rendering is improved.
void WzMainWindow::drawPixmap(int XPos, int YPos, QPixmap *pix)
{
QPainter painter(context()->device());
painter.drawPixmap(XPos, YPos, *pix);
painter.end();
glEnable(GL_CULL_FACE);
rendStatesRendModeHack(); // rendStates.rendMode = REND_ALPHA;
pie_SetRendMode(REND_OPAQUE); // beat state machinery into submission
}
示例15: pie_DrawSkybox
void pie_DrawSkybox(float scale, const glm::mat4 &viewMatrix)
{
// no use in updating the depth buffer
glDepthMask(GL_FALSE);
// enable alpha
pie_SetRendMode(REND_ALPHA);
// Apply scale matrix
skyboxGfx->draw(pie_PerspectiveGet() * viewMatrix * glm::scale(scale, scale / 2.f, scale));
}