/*
==================
R_NV20_Init

==================
*/
void R_NV20_Init(void)
{
	glConfig.allowNV20Path = false;

	common->Printf("---------- R_NV20_Init ----------\n");

	if (!glConfig.registerCombinersAvailable || !glConfig.ARBVertexProgramAvailable || glConfig.maxTextureUnits < 4) {
		common->Printf("Not available.\n");
		return;
	}

	GL_CheckErrors();

	// create our "fragment program" display lists
	fragmentDisplayListBase = qglGenLists(FPROG_NUM_FRAGMENT_PROGRAMS);

	// force them to issue commands to build the list
	bool temp = r_useCombinerDisplayLists.GetBool();
	r_useCombinerDisplayLists.SetBool(false);

	qglNewList(fragmentDisplayListBase + FPROG_BUMP_AND_LIGHT, GL_COMPILE);
	RB_NV20_BumpAndLightFragment();
	qglEndList();

	qglNewList(fragmentDisplayListBase + FPROG_DIFFUSE_COLOR, GL_COMPILE);
	RB_NV20_DiffuseColorFragment();
	qglEndList();

	qglNewList(fragmentDisplayListBase + FPROG_SPECULAR_COLOR, GL_COMPILE);
	RB_NV20_SpecularColorFragment();
	qglEndList();

	qglNewList(fragmentDisplayListBase + FPROG_DIFFUSE_AND_SPECULAR_COLOR, GL_COMPILE);
	RB_NV20_DiffuseAndSpecularColorFragment();
	qglEndList();

	r_useCombinerDisplayLists.SetBool(temp);

	common->Printf("---------------------------------\n");

	glConfig.allowNV20Path = true;
}
void WINAPI Pointfile_Check (void)
{
    char	name[1024];
    FILE	*f;
    idVec3	v;

    strcpy (name, currentmap);
    StripExtension (name);
    strcat (name, ".lin");

    f = fopen (name, "r");
    if (!f)
        return;

    common->Printf ("Reading pointfile %s\n", name);

    if (!g_qeglobals.d_pointfile_display_list)
        g_qeglobals.d_pointfile_display_list = qglGenLists(1);

    s_num_points = 0;
    qglNewList (g_qeglobals.d_pointfile_display_list,  GL_COMPILE);
    qglColor3f (1, 0, 0);
    qglDisable(GL_TEXTURE_2D);
    qglDisable(GL_TEXTURE_1D);
    qglLineWidth (2);
    qglBegin(GL_LINE_STRIP);
    do
    {
        if (fscanf (f, "%f %f %f\n", &v[0], &v[1], &v[2]) != 3)
            break;
        if (s_num_points < MAX_POINTFILE)
        {
            VectorCopy (v, s_pointvecs[s_num_points]);
            s_num_points++;
        }
        qglVertex3fv( v.ToFloatPtr() );
    }
    while (1);
    qglEnd();
    qglLineWidth (0.5);
    qglEndList ();

    s_check_point = 0;
    fclose (f);
    //Pointfile_Next ();
}