Tex *add_texture(Main *bmain, const char *name) { Tex *tex; tex = BKE_libblock_alloc(&bmain->tex, ID_TE, name); default_tex(tex); return tex; }
Tex *add_texture(const char *name) { Main *bmain= G.main; Tex *tex; tex= alloc_libblock(&bmain->tex, ID_TE, name); default_tex(tex); return tex; }
static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp)) { Tex *tex = MEM_callocN(sizeof(Tex), "Tex"); node->storage= tex; default_tex(tex); tex->type = node->type - TEX_NODE_PROC; if (tex->type == TEX_WOOD) tex->stype = TEX_BANDNOISE; }
static void init(bNode *node) { Tex *tex = MEM_callocN(sizeof(Tex), "Tex"); node->storage= tex; default_tex(tex); tex->type = node->type - TEX_NODE_PROC; if(tex->type == TEX_WOOD) tex->stype = TEX_BANDNOISE; }
void loop(void) { const float spd1=30.0f*dt(); const float spd2=15.0f*dt(); float r=0.0f; float dc=0.0f, ds=0.0f; float tc=0.0f, ts=0.0f; /*viewport(0,0,nsw,nsh);*/ use_basic(); send_lpview(pview); if(mm() || mw()!=0.0f) { if(mm()) { dir+=mx()*spd1; if(dir<-0.0f) { dir+=360.0f; ndir+=360.0f; } else if(dir>360.0f) { dir-=360.0f; ndir-=360.0f; } tilt-=my()*spd1; if(tilt<0.001f) tilt=0.001f; else if(tilt>100.0f) tilt=100.0f; } if(mw()!=0.0f) { zoom-=mw(); if(zoom<7.0f) zoom=7.0f; else if(zoom>12.0f) zoom=12.0f; } } if(mp(3)) zoom=10.0f; ndir-=(ndir-dir)*spd2; r=d2r(ndir); dc=cosf(r); ds=sinf(r); ntilt-=(ntilt-tilt)*spd2; r=d2r(ntilt); tc=cosf(r); ts=sinf(r); nzoom-=(nzoom-zoom)*spd2; look(view,v3(ds*ts*nzoom,dc*ts*nzoom,3.0f+(tc*nzoom)),v3(0.0f,0.0f,3.0f)); mult(pview,proj,view); send_pview(pview); /* ----- */ use_fb(fbos[0]); clear(); /* ----- */ use_tex(area_tex); /* ----- */ draw_vbo(&area_mod); use_fb(0); blit_fb(fbos[0],fbos[1],nsw,nsh); /* ----- */ use_fb(fbos[2]); set_drawbufs(2); clear(); draw_vbo(&area_mod); use_fb(0); use_mblur(); use_tex(texs[0]); /* ----- */ active_tex(GL_TEXTURE1,texs[2]); default_tex(); use_fb(fbos[3]); set_drawbufs(1); clear(); quad(); use_fb(0); active_tex(GL_TEXTURE1,0); default_tex(); /*viewport(0,0,sw,sh);*/ use_vig(); use_tex(texs[3]); clear(); quad(); if(kp(SDL_SCANCODE_DELETE) || kp(SDL_SCANCODE_ESCAPE)) quit(); }