Beispiel #1
0
static void gl_cg_deinit_progs(void *data)
{
   unsigned i;
   cg_shader_data_t *cg_data = (cg_shader_data_t*)data;

   if (!cg_data)
      return;

   RARCH_LOG("CG: Destroying programs.\n");
   cgGLUnbindProgram(cg_data->cgFProf);
   cgGLUnbindProgram(cg_data->cgVProf);

   /* Programs may alias [0]. */
   for (i = 1; i < GFX_MAX_SHADERS; i++)
   {
      if (cg_data->prg[i].fprg && cg_data->prg[i].fprg != cg_data->prg[0].fprg)
         cgDestroyProgram(cg_data->prg[i].fprg);
      if (cg_data->prg[i].vprg && cg_data->prg[i].vprg != cg_data->prg[0].vprg)
         cgDestroyProgram(cg_data->prg[i].vprg);
   }

   if (cg_data->prg[0].fprg)
      cgDestroyProgram(cg_data->prg[0].fprg);
   if (cg_data->prg[0].vprg)
      cgDestroyProgram(cg_data->prg[0].vprg);

   memset(cg_data->prg, 0, sizeof(cg_data->prg));
}
Beispiel #2
0
void newScenes(int sc1, int sc2)
{
    sprintf(fileName, "cg_%d_%d.txt", sc1, sc2);
    fileName[10] = '\0';
    
    if((pts = fopen(fileName, "r")) == NULL){
        printf("Couldn't open file: %s\n", fileName);
        exit(EXIT_FAILURE);
    }
    char *ln;
    size_t sz;
	posLen = 0;
    while((ln = fgetln(pts, &sz)) != NULL)
    {
        fillPoint(&(posList[posLen]), ln);
        posLen++;
    }
    fclose(pts);
	
	sprintf(progName, "cg_%d_%d.cg", sc1, sc2);
	cgGLUnbindProgram(f_prof);
	cgGLEnableProfile(f_prof);
	gen = cgCreateProgramFromFile(context, CG_SOURCE, progName, f_prof, "main", NULL);
	cgGLLoadProgram(gen);
	cgGLBindProgram(gen);
	cgGLEnableProfile(f_prof);
}
Beispiel #3
0
void GLCgShader::UnbindShader()
{
	cgGLUnbindProgram(m_cgProfile);
	cgGLDisableProfile(m_cgProfile);
	if (m_focus == Shader::SF_PIXEL)
		DisableTextures();
}
Beispiel #4
0
void cgShader_3::Disable(){
    for(int k = 0; k < 5; k++){
        if(cgProgram[k]){
            cgGLUnbindProgram(cgProfile[k]);
            cgGLDisableProfile(cgProfile[k]);
        }
    }
}
Beispiel #5
0
static void gl_cg_deinit_progs(void)
{
   RARCH_LOG("CG: Destroying programs.\n");
   cgGLUnbindProgram(cgFProf);
   cgGLUnbindProgram(cgVProf);

   // Programs may alias [0].
   for (unsigned i = 1; i < GFX_MAX_SHADERS; i++)
   {
      if (prg[i].fprg && prg[i].fprg != prg[0].fprg)
         cgDestroyProgram(prg[i].fprg);
      if (prg[i].vprg && prg[i].vprg != prg[0].vprg)
         cgDestroyProgram(prg[i].vprg);
   }

   if (prg[0].fprg)
      cgDestroyProgram(prg[0].fprg);
   if (prg[0].vprg)
      cgDestroyProgram(prg[0].vprg);

   memset(prg, 0, sizeof(prg));
}
void COpenGLCgMaterialRenderer::OnUnsetMaterial()
{
    if (VertexProgram)
    {
        cgGLUnbindProgram(VertexProfile);
        cgGLDisableProfile(VertexProfile);
    }
    if (FragmentProgram)
    {
        cgGLUnbindProgram(FragmentProfile);
        cgGLDisableProfile(FragmentProfile);
    }
    if (GeometryProgram)
    {
        cgGLUnbindProgram(GeometryProfile);
        cgGLDisableProfile(GeometryProfile);
    }

    if (BaseMaterial)
        BaseMaterial->OnUnsetMaterial();

    Material = IdentityMaterial;;
}
Beispiel #7
0
void FFxProgram::unbind()
{
#ifdef WIN32
	if (GDD->GetClassID() == ClassIDZDisplayDeviceDX9)
	{
	}
	else
#endif
	{
	cgGLDisableProfile(mProfile);
	cgGLUnbindProgram(mProfile);
	}
	/*
#ifdef WIN32
    extern LPDIRECT3DDEVICE9	gD3DDevice;
    gD3DDevice->SetVertexShader(NULL);
    gD3DDevice->SetPixelShader(NULL);
#else
	cgGLDisableProfile(mProfile);
	cgGLUnbindProgram(mProfile);
#endif
	*/
}
void CgShaderProgramGL::unbind()
{
    cgGLUnbindProgram(cgProfile_);
    cgGLDisableProfile(cgProfile_);
}
Beispiel #9
0
	void	IOGLBaseShader::Unbind(){
		cgGLUnbindProgram(this->GetProfile());
		cgGLDisableProfile(this->GetProfile());
		this->m_bBinded = false;
	}
Beispiel #10
0
 void CgGLShader::unbind() {
     if(mProgram) {
         cgGLUnbindProgram(mProfile);
     }
 }