From Jeremy Moles, Updated file references to reflect new data in OpenSceneGraph-Data
This commit is contained in:
parent
a8cb408213
commit
a20e5791d9
@ -13,7 +13,7 @@ class ABCWidget: public osgWidget::Label {
|
|||||||
public:
|
public:
|
||||||
ABCWidget(const std::string& label):
|
ABCWidget(const std::string& label):
|
||||||
osgWidget::Label("", label) {
|
osgWidget::Label("", label) {
|
||||||
setFont("fonts/Calibri1.ttf");
|
setFont("fonts/Vera.ttf");
|
||||||
setFontSize(20);
|
setFontSize(20);
|
||||||
setCanFill(true);
|
setCanFill(true);
|
||||||
setShadow(0.08f);
|
setShadow(0.08f);
|
||||||
@ -25,7 +25,7 @@ class Button: public osgWidget::Label {
|
|||||||
public:
|
public:
|
||||||
Button(const std::string& label):
|
Button(const std::string& label):
|
||||||
osgWidget::Label("", label) {
|
osgWidget::Label("", label) {
|
||||||
setFont("fonts/Calibri1.ttf");
|
setFont("fonts/Vera.ttf");
|
||||||
setFontSize(30);
|
setFontSize(30);
|
||||||
setColor(0.8f, 0.2f, 0.2f, 0.8f);
|
setColor(0.8f, 0.2f, 0.2f, 0.8f);
|
||||||
setCanFill(true);
|
setCanFill(true);
|
||||||
|
@ -54,10 +54,10 @@ int main(int argc, char** argv) {
|
|||||||
osgWidget::Widget* t = frame->getBorder(osgWidget::Frame::BORDER_TOP);
|
osgWidget::Widget* t = frame->getBorder(osgWidget::Frame::BORDER_TOP);
|
||||||
osgWidget::Widget* b = frame->getBorder(osgWidget::Frame::BORDER_BOTTOM);
|
osgWidget::Widget* b = frame->getBorder(osgWidget::Frame::BORDER_BOTTOM);
|
||||||
|
|
||||||
l->setImage("../examples/osgwidgetframe/images/border-left.tga", true);
|
l->setImage("osgWidget/border-left.tga", true);
|
||||||
r->setImage("../examples/osgwidgetframe/images/border-right.tga", true);
|
r->setImage("osgWidget/border-right.tga", true);
|
||||||
t->setImage("../examples/osgwidgetframe/images/border-top.tga", true);
|
t->setImage("osgWidget/border-top.tga", true);
|
||||||
b->setImage("../examples/osgwidgetframe/images/border-bottom.tga", true);
|
b->setImage("osgWidget/border-bottom.tga", true);
|
||||||
|
|
||||||
l->setTexCoordWrapVertical();
|
l->setTexCoordWrapVertical();
|
||||||
r->setTexCoordWrapVertical();
|
r->setTexCoordWrapVertical();
|
||||||
@ -69,9 +69,9 @@ int main(int argc, char** argv) {
|
|||||||
osgWidget::Widget* center = new osgWidget::Widget("center", 256.0f, 256.0f);
|
osgWidget::Widget* center = new osgWidget::Widget("center", 256.0f, 256.0f);
|
||||||
osgWidget::Widget* right = new osgWidget::Widget("right", 512.0f, 256.0f);
|
osgWidget::Widget* right = new osgWidget::Widget("right", 512.0f, 256.0f);
|
||||||
|
|
||||||
left->setImage("../examples/osgwidgetframe/images/panel-left.tga", true);
|
left->setImage ("osgWidget/panel-left.tga", true);
|
||||||
center->setImage("../examples/osgwidgetframe/images/panel-center.tga", true);
|
center->setImage("osgWidget/panel-center.tga", true);
|
||||||
right->setImage("../examples/osgwidgetframe/images/panel-right.tga", true);
|
right->setImage ("osgWidget/panel-right.tga", true);
|
||||||
|
|
||||||
center->setTexCoordWrapHorizontal();
|
center->setTexCoordWrapHorizontal();
|
||||||
|
|
||||||
|
@ -22,8 +22,7 @@ const char* INFO =
|
|||||||
void setupLabel(osgWidget::Label* label) {
|
void setupLabel(osgWidget::Label* label) {
|
||||||
label->setFontSize(16);
|
label->setFontSize(16);
|
||||||
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
// label->setFont("fonts/monospace.ttf");
|
label->setFont("fonts/Vera.ttf");
|
||||||
label->setFont("fonts/Calibri1.ttf");
|
|
||||||
label->setPadding(2.0f);
|
label->setPadding(2.0f);
|
||||||
label->setHeight(18.0f);
|
label->setHeight(18.0f);
|
||||||
label->setCanFill(true);
|
label->setCanFill(true);
|
||||||
|
@ -25,7 +25,7 @@ const char* LABEL2 =
|
|||||||
osgWidget::Label* createLabel(const std::string& l, unsigned int size=13) {
|
osgWidget::Label* createLabel(const std::string& l, unsigned int size=13) {
|
||||||
osgWidget::Label* label = new osgWidget::Label("", "");
|
osgWidget::Label* label = new osgWidget::Label("", "");
|
||||||
|
|
||||||
label->setFont("fonts/arial.ttf");
|
label->setFont("fonts/Vera.ttf");
|
||||||
label->setFontSize(size);
|
label->setFontSize(size);
|
||||||
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
label->setLabel(l);
|
label->setLabel(l);
|
||||||
|
@ -17,7 +17,7 @@ const unsigned int MASK_3D = 0x0F000000;
|
|||||||
struct ColorLabel: public osgWidget::Label {
|
struct ColorLabel: public osgWidget::Label {
|
||||||
ColorLabel(const char* label):
|
ColorLabel(const char* label):
|
||||||
osgWidget::Label("", "") {
|
osgWidget::Label("", "") {
|
||||||
setFont("fonts/Calibri1.ttf");
|
setFont("fonts/Vera.ttf");
|
||||||
setFontSize(14);
|
setFontSize(14);
|
||||||
setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
setColor(0.3f, 0.3f, 0.3f, 1.0f);
|
setColor(0.3f, 0.3f, 0.3f, 1.0f);
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
osgWidget::Label* label1 = new osgWidget::Label(ss.str());
|
osgWidget::Label* label1 = new osgWidget::Label(ss.str());
|
||||||
|
|
||||||
label1->setFont("fonts/monospace.ttf");
|
label1->setFont("fonts/VeraMono.ttf");
|
||||||
label1->setFontSize(20);
|
label1->setFontSize(20);
|
||||||
label1->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
label1->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
label1->setColor(0.0f, i / 4.0f, 0.3f, 1.0f);
|
label1->setColor(0.0f, i / 4.0f, 0.3f, 1.0f);
|
||||||
@ -73,7 +73,7 @@ public:
|
|||||||
|
|
||||||
osgWidget::Label* label2 = new osgWidget::Label(ss.str());
|
osgWidget::Label* label2 = new osgWidget::Label(ss.str());
|
||||||
|
|
||||||
label2->setFont("fonts/monospace.ttf");
|
label2->setFont("fonts/Vera.ttf");
|
||||||
label2->setFontSize(15);
|
label2->setFontSize(15);
|
||||||
label2->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
label2->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
label2->setColor(0.0f, i / 4.0f, 0.3f, 1.0f);
|
label2->setColor(0.0f, i / 4.0f, 0.3f, 1.0f);
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
|
|
||||||
osgWidget::Label* label = new osgWidget::Label("label");
|
osgWidget::Label* label = new osgWidget::Label("label");
|
||||||
|
|
||||||
label->setFont("fonts/monospace.ttf");
|
label->setFont("fonts/arial.ttf");
|
||||||
label->setFontSize(15);
|
label->setFontSize(15);
|
||||||
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
label->setLabel("Drag the window here...");
|
label->setLabel("Drag the window here...");
|
||||||
|
@ -88,7 +88,7 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrameWithSingleTexture(
|
osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrameWithSingleTexture(
|
||||||
"frame",
|
"frame",
|
||||||
"../examples/osgwidgetscrolled/theme-2.png",
|
"osgWidget/theme-2.png",
|
||||||
64.0f,
|
64.0f,
|
||||||
64.0f,
|
64.0f,
|
||||||
16.0f,
|
16.0f,
|
||||||
@ -101,15 +101,15 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
// This is our Transformers box. :)
|
// This is our Transformers box. :)
|
||||||
osgWidget::Box* box = new osgWidget::Box("images", osgWidget::Box::VERTICAL);
|
osgWidget::Box* box = new osgWidget::Box("images", osgWidget::Box::VERTICAL);
|
||||||
osgWidget::Widget* img1 = new osgWidget::Widget("im1", 256.0f, 256.0f);
|
osgWidget::Widget* img1 = new osgWidget::Widget("im1", 512.0f, 512.0f);
|
||||||
osgWidget::Widget* img2 = new osgWidget::Widget("im2", 256.0f, 256.0f);
|
osgWidget::Widget* img2 = new osgWidget::Widget("im2", 512.0f, 512.0f);
|
||||||
osgWidget::Widget* img3 = new osgWidget::Widget("im3", 256.0f, 256.0f);
|
osgWidget::Widget* img3 = new osgWidget::Widget("im3", 512.0f, 512.0f);
|
||||||
osgWidget::Widget* img4 = new osgWidget::Widget("im4", 256.0f, 256.0f);
|
osgWidget::Widget* img4 = new osgWidget::Widget("im4", 512.0f, 512.0f);
|
||||||
|
|
||||||
img1->setImage("../examples/osgwidgetscrolled/images/starscream.jpg", true);
|
img1->setImage("osgWidget/scrolled1.jpg", true);
|
||||||
img2->setImage("../examples/osgwidgetscrolled/images/optimus.jpg", true);
|
img2->setImage("osgWidget/scrolled2.jpg", true);
|
||||||
img3->setImage("../examples/osgwidgetscrolled/images/megatron.jpg", true);
|
img3->setImage("osgWidget/scrolled3.jpg", true);
|
||||||
img4->setImage("../examples/osgwidgetscrolled/images/bumblebee.jpg", true);
|
img4->setImage("osgWidget/scrolled4.jpg", true);
|
||||||
|
|
||||||
img1->setMinimumSize(10.0f, 10.0f);
|
img1->setMinimumSize(10.0f, 10.0f);
|
||||||
img2->setMinimumSize(10.0f, 10.0f);
|
img2->setMinimumSize(10.0f, 10.0f);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// -*-c++-*- osgWidget - Code by: Jeremy Moles (cubicool) 2007-2008
|
// -*-c++-*- osgWidget - Code by: Jeremy Moles (cubicool) 2007-2008
|
||||||
// $Id: osgwidgetshader.cpp 28 2008-03-26 15:26:48Z cubicool $
|
// $Id: osgwidgetshader.cpp 28 2008-03-26 15:26:48Z cubicool $
|
||||||
|
|
||||||
|
#include <osgDB/FileUtils>
|
||||||
#include <osgWidget/Util>
|
#include <osgWidget/Util>
|
||||||
#include <osgWidget/WindowManager>
|
#include <osgWidget/WindowManager>
|
||||||
#include <osgWidget/Canvas>
|
#include <osgWidget/Canvas>
|
||||||
@ -60,12 +61,12 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
program->addShader(osg::Shader::readShaderFile(
|
program->addShader(osg::Shader::readShaderFile(
|
||||||
osg::Shader::VERTEX,
|
osg::Shader::VERTEX,
|
||||||
"osgWidget/osgwidgetshader-vert.glsl"
|
osgDB::findDataFile("osgWidget/osgwidgetshader-vert.glsl")
|
||||||
));
|
));
|
||||||
|
|
||||||
program->addShader(osg::Shader::readShaderFile(
|
program->addShader(osg::Shader::readShaderFile(
|
||||||
osg::Shader::FRAGMENT,
|
osg::Shader::FRAGMENT,
|
||||||
"osgWidget/osgwidgetshader-frag.glsl"
|
osgDB::findDataFile("osgWidget/osgwidgetshader-frag.glsl")
|
||||||
));
|
));
|
||||||
|
|
||||||
canvas->getGeode()->getOrCreateStateSet()->setAttribute(program);
|
canvas->getGeode()->getOrCreateStateSet()->setAttribute(program);
|
||||||
|
Loading…
Reference in New Issue
Block a user