mirror of https://github.com/xemu-project/xemu.git
nv2a/gl: Rebase line width feature
This commit is contained in:
parent
92617d3a31
commit
ae3fe91223
|
@ -321,8 +321,10 @@ void pgraph_gl_draw_begin(NV2AState *d)
|
|||
if (!anti_aliasing && pgraph_reg_r(pg, NV_PGRAPH_SETUPRASTER) &
|
||||
NV_PGRAPH_SETUPRASTER_LINESMOOTHENABLE) {
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glLineWidth(MIN(r->supportedSmoothLineWidthRange[1], pg->surface_scale_factor));
|
||||
} else {
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
glLineWidth(MIN(r->supportedAliasedLineWidthRange[1], pg->surface_scale_factor));
|
||||
}
|
||||
if (!anti_aliasing && pgraph_reg_r(pg, NV_PGRAPH_SETUPRASTER) &
|
||||
NV_PGRAPH_SETUPRASTER_POLYSMOOTHENABLE) {
|
||||
|
|
|
@ -38,6 +38,7 @@ static void pgraph_gl_init(NV2AState *d, Error **errp)
|
|||
PGRAPHState *pg = &d->pgraph;
|
||||
|
||||
pg->gl_renderer_state = g_malloc0(sizeof(*pg->gl_renderer_state));
|
||||
PGRAPHGLState *r = pg->gl_renderer_state;
|
||||
|
||||
/* fire up opengl */
|
||||
glo_set_current(g_nv2a_context_render);
|
||||
|
@ -51,6 +52,9 @@ static void pgraph_gl_init(NV2AState *d, Error **errp)
|
|||
/* Internal RGB565 texture format */
|
||||
assert(glo_check_extension("GL_ARB_ES2_compatibility"));
|
||||
|
||||
glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, r->supportedSmoothLineWidthRange);
|
||||
glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, r->supportedAliasedLineWidthRange);
|
||||
|
||||
pgraph_gl_init_surfaces(pg);
|
||||
pgraph_gl_init_reports(d);
|
||||
pgraph_gl_init_textures(d);
|
||||
|
|
|
@ -229,6 +229,9 @@ typedef struct PGRAPHGLState {
|
|||
GLint pvideo_color_key_loc;
|
||||
GLint palette_loc[256];
|
||||
} disp_rndr;
|
||||
|
||||
GLfloat supportedAliasedLineWidthRange[2];
|
||||
GLfloat supportedSmoothLineWidthRange[2];
|
||||
} PGRAPHGLState;
|
||||
|
||||
extern GloContext *g_nv2a_context_render;
|
||||
|
|
Loading…
Reference in New Issue