Browse Source

Experiment with lines

pull/1/head
falkTX 11 years ago
parent
commit
899b185ce7
4 changed files with 41 additions and 7 deletions
  1. +1
    -1
      dpf
  2. +1
    -1
      examples/color.cpp
  3. +38
    -4
      examples/demo.cpp
  4. +1
    -1
      examples/rectangles.cpp

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit 5c4b72d8d88fbbe30cab1bd117001d3432dfbfe3
Subproject commit 6051bb2c1dc4368389f18e13b1a4275435460280

+ 1
- 1
examples/color.cpp View File

@@ -27,7 +27,7 @@
using namespace DGL;

// ------------------------------------------------------
// Single color widget
// our widget

class ColorWidget : public Widget,
public IdleCallback


+ 38
- 4
examples/demo.cpp View File

@@ -26,6 +26,40 @@

using namespace DGL;

// ------------------------------------------------------
// our widget

class DummyWidget : public Widget
{
public:
DummyWidget(Window& win)
: Widget(win)
{
l1.setStartPos(5, 5);
l2.setStartPos(5, 5+50);
l3.setStartPos(5, 5+100);

l1.setEndPos(300-5, 5);
l2.setEndPos(300-5, 5+50);
l3.setEndPos(300-5, 5+100);
}

protected:
void onDisplay() override
{
glColor3f(0.3f, 0.5f, 0.8f);
l1.draw();

glColor3f(0.5f, 0.8f, 0.3f);
l2.draw();

glColor3f(0.8f, 0.3f, 0.5f);
l3.draw();
}

Line<int> l1, l2, l3;
};

// ------------------------------------------------------
// Our Demo Window

@@ -33,15 +67,15 @@ class DemoWindow : public Window
{
public:
DemoWindow(App& app)
: Window(app)//,
//w1(*this)
: Window(app),
w1(*this)
{
setSize(300, 300);
setTitle("DGL Demo");
}

//private:
//Widget_Geometry w1;
private:
DummyWidget w1;
};

// ------------------------------------------------------


+ 1
- 1
examples/rectangles.cpp View File

@@ -27,7 +27,7 @@
using namespace DGL;

// ------------------------------------------------------
// Geometry
// our widget

class RectanglesWidget : public Widget
{


Loading…
Cancel
Save