Exemplo n.º 1
0
void    GL_RenderPath()
{
	if ( navrep_render.integer != -1 )
	{
		vec4_t white = {1,1,1,1};
		
		GL_DisableTexture(GL_TEXTURE0_ARB);
		GL_Disable(GL_LIGHTING);
		GL_SetColor(white);
		
		glBegin(GL_LINES);
				NavRep_Render();
		glEnd();
	}
}
Exemplo n.º 2
0
static void
GL_SetDrawingState(SDL_Renderer * renderer)
{
    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;

    GL_ActivateRenderer(renderer);

    GL_SetColor(data, renderer->r,
                      renderer->g,
                      renderer->b,
                      renderer->a);

    GL_SetBlendMode(data, renderer->blendMode);

    GL_SetShader(data, SHADER_SOLID);
}
Exemplo n.º 3
0
static int
GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
              const SDL_Rect * srcrect, const SDL_Rect * dstrect)
{
    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
    GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata;
    int minx, miny, maxx, maxy;
    GLfloat minu, maxu, minv, maxv;

    GL_ActivateRenderer(renderer);

    data->glEnable(texturedata->type);
    if (texturedata->yuv) {
        data->glActiveTextureARB(GL_TEXTURE2_ARB);
        data->glBindTexture(texturedata->type, texturedata->vtexture);
        if (texturedata->scaleMode != data->current.scaleMode) {
            data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
                                  texturedata->scaleMode);
            data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
                                  texturedata->scaleMode);
        }

        data->glActiveTextureARB(GL_TEXTURE1_ARB);
        data->glBindTexture(texturedata->type, texturedata->utexture);
        if (texturedata->scaleMode != data->current.scaleMode) {
            data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
                                  texturedata->scaleMode);
            data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
                                  texturedata->scaleMode);
        }

        data->glActiveTextureARB(GL_TEXTURE0_ARB);
    }
    data->glBindTexture(texturedata->type, texturedata->texture);

    if (texturedata->scaleMode != data->current.scaleMode) {
        data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
                              texturedata->scaleMode);
        data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
                              texturedata->scaleMode);
        data->current.scaleMode = texturedata->scaleMode;
    }

    if (texture->modMode) {
        GL_SetColor(data, texture->r, texture->g, texture->b, texture->a);
    } else {
        GL_SetColor(data, 255, 255, 255, 255);
    }

    GL_SetBlendMode(data, texture->blendMode);

    if (texturedata->yuv) {
        GL_SetShader(data, SHADER_YV12);
    } else {
        GL_SetShader(data, SHADER_RGB);
    }

    minx = dstrect->x;
    miny = dstrect->y;
    maxx = dstrect->x + dstrect->w;
    maxy = dstrect->y + dstrect->h;

    minu = (GLfloat) srcrect->x / texture->w;
    minu *= texturedata->texw;
    maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
    maxu *= texturedata->texw;
    minv = (GLfloat) srcrect->y / texture->h;
    minv *= texturedata->texh;
    maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
    maxv *= texturedata->texh;

    data->glBegin(GL_TRIANGLE_STRIP);
    data->glTexCoord2f(minu, minv);
    data->glVertex2f((GLfloat) minx, (GLfloat) miny);
    data->glTexCoord2f(maxu, minv);
    data->glVertex2f((GLfloat) maxx, (GLfloat) miny);
    data->glTexCoord2f(minu, maxv);
    data->glVertex2f((GLfloat) minx, (GLfloat) maxy);
    data->glTexCoord2f(maxu, maxv);
    data->glVertex2f((GLfloat) maxx, (GLfloat) maxy);
    data->glEnd();

    data->glDisable(texturedata->type);

    return 0;
}
Exemplo n.º 4
0
void glColor4ubv (const GLubyte *v)
{
	GL_SetColor (v[0], v[1], v[2], v[3]);
}
Exemplo n.º 5
0
void glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
{
	GL_SetColor (red, green, blue, alpha);
}
Exemplo n.º 6
0
void glColor4fv (const GLfloat *v)
{
	GL_SetColor (v[0] * 255, v[1] * 255, v[2] * 255, v[3] * 255);
}
Exemplo n.º 7
0
void glColor4x (GLint red, GLint green, GLint blue, GLint alpha)
{
	GL_SetColor (red * 255, green * 255, blue * 255, alpha * 255);
}
Exemplo n.º 8
0
void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
	GL_SetColor (red * 255, green * 255, blue * 255, alpha * 255);
}
Exemplo n.º 9
0
void glColor3ubv (const GLubyte *v)
{
	GL_SetColor (v[0], v[1], v[2], 255);
}
Exemplo n.º 10
0
/*
void GL_SetColor (float red, float green, float blue, float alpha)
{
	xe_CurrentColor.a = alpha;
	xe_CurrentColor.r = red;
	xe_CurrentColor.g = green;
	xe_CurrentColor.b = blue;
}
*/
void glColor3f (GLfloat red, GLfloat green, GLfloat blue)
{
	GL_SetColor (red * 255, green * 255, blue * 255, 255);
}