mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
materials are now created by specifying shaders
shader uniforms are added to materials
This commit is contained in:
+3
-3
@@ -51,12 +51,12 @@ int main(){
|
||||
* Creates a material for text objects and
|
||||
* attaches a diffuse texture with 2 images
|
||||
*/
|
||||
Material *textMat = new Material(Material::MATERIAL_TEXT);
|
||||
textMat->setTexturingEnabled(true);
|
||||
Material *textMat = new Material(PATH + "text");
|
||||
textMat->addVariable("texturingEnabled", true);
|
||||
|
||||
string frames[]{TEX_PATH + "bricks.jpg", TEX_PATH + "defaultTexture.jpg"};
|
||||
Texture *texture = new Texture(frames, 2);
|
||||
textMat->addDiffuseMap(texture);
|
||||
textMat->addVariable("textures[0]", texture);
|
||||
|
||||
for(int i = 0; i < numTexts; i++){
|
||||
Text *text = new Text(FONT_PATH + fonts[i], texts[i]);
|
||||
|
||||
Reference in New Issue
Block a user