Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-05-29 01:19:56 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-05-29 01:19:56 +0400
commit9986b5cd736a493026c9580a49bbf030cd1fa4be (patch)
tree6e6e3d36059cd890805fce1f7afbb743f3dfc5e0 /source/blender/freestyle/intern/app_blender
parent58066fd0af30388a6bf29fa897fb0300b37c5c7b (diff)
soc-2008-mxcurioni: corrected GLStrokeRender::preparePaper function for paper texture loading. The canvas view now has its frame properly initialized to fixed dimensions. When the Freestyle render is executed, the render is displayed for a fraction of a second and is then erased by a standard gray background. I have to analyze what command I need to call to keep the result on display.
Diffstat (limited to 'source/blender/freestyle/intern/app_blender')
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/AppCanvas.cpp2
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/AppGLWidget.cpp15
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/AppGLWidget.h14
-rw-r--r--source/blender/freestyle/intern/app_blender/api.cpp4
4 files changed, 15 insertions, 20 deletions
diff --git a/source/blender/freestyle/intern/app_blender/AppCanvas.cpp b/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
index 5125bf5f70b..98013cf18d4 100755
--- a/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
+++ b/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
@@ -214,7 +214,7 @@ void AppCanvas::update()
// char number[10];
//
_pViewer->updateGL();
- _pViewer->swapBuffers();
+ //_pViewer->swapBuffers();
//QImage fb = _pViewer->grabFrameBuffer();
// sprintf(number, "%3d", counter);
// strcat(fileName, number);
diff --git a/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp b/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp
index 18e9639342d..a06e25d72be 100755
--- a/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp
+++ b/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp
@@ -618,22 +618,13 @@ bool AppGLWidget::getBackBufferFlag() {
// COPIED FROM LIBQGLVIEWER
//*******************************
- // inherited
- void AppGLWidget::swapBuffers() {}
-
+ // inherited
//Updates the display. Do not call draw() directly, use this method instead.
void AppGLWidget::updateGL() {}
//Makes this widget's rendering context the current OpenGL rendering context. Useful with several viewers
- void AppGLWidget::makeCurrent() {}
-
+ void AppGLWidget::makeCurrent() { }
// not-inherited
-
- // Convenient way to call setSceneCenter() and setSceneRadius() from a (world axis aligned) bounding box of the scene.
- void AppGLWidget::setSceneBoundingBox(const Vec& min, const Vec& max) { _camera->setSceneBoundingBox(min,max); }
-
- void AppGLWidget::saveSnapshot(bool b) {}
-
void AppGLWidget::setStateFileName(const string& name) { stateFileName_ = name; };
-
+ void AppGLWidget::saveSnapshot(bool b) {}
diff --git a/source/blender/freestyle/intern/app_blender/AppGLWidget.h b/source/blender/freestyle/intern/app_blender/AppGLWidget.h
index 3cf7844876d..15238ba6269 100755
--- a/source/blender/freestyle/intern/app_blender/AppGLWidget.h
+++ b/source/blender/freestyle/intern/app_blender/AppGLWidget.h
@@ -47,6 +47,7 @@ using namespace std;
# include "../rendering/GLDebugRenderer.h"
//# include <QGLViewer/qglviewer.h>
+
//soc
#include "AppGLWidget_camera.h"
#include "AppGLWidget_vec.h"
@@ -76,14 +77,15 @@ public:
public:
//inherited
- inline real width() { return _width; }
- inline real height() { return _height; }
- void swapBuffers();
+ inline unsigned int width() { return _width; }
+ inline unsigned int height() { return _height; }
+ inline void setWidth( unsigned int width ) { _width = width; }
+ inline void setHeight( unsigned int height ) { _height = height; }
+
void updateGL();
void makeCurrent();
// not-inherited
- void setSceneBoundingBox(const Vec& min, const Vec& max);
void saveSnapshot(bool b);
void setStateFileName(const string& name);
@@ -91,7 +93,7 @@ public:
Camera * _camera;
protected:
- real _width, _height;
+ unsigned int _width, _height;
Vec _min,_max;
string stateFileName_;
@@ -306,7 +308,7 @@ public:
Vec max_(_ModelRootNode->bbox().getMax()[0],
_ModelRootNode->bbox().getMax()[1],
_ModelRootNode->bbox().getMax()[2]);
- setSceneBoundingBox(min_, max_);
+ _camera->setSceneBoundingBox(min_, max_);
_camera->showEntireScene();
}
diff --git a/source/blender/freestyle/intern/app_blender/api.cpp b/source/blender/freestyle/intern/app_blender/api.cpp
index 5f3d8224ec5..eb29580f891 100644
--- a/source/blender/freestyle/intern/app_blender/api.cpp
+++ b/source/blender/freestyle/intern/app_blender/api.cpp
@@ -20,7 +20,9 @@ extern "C" {
AppGLWidget *view = new AppGLWidget;
c->SetView(view);
-
+ view->setWidth(640);
+ view->setHeight(640);
+
c->Load3DSFile( TEST_3DS_FILE );
c->InsertStyleModule( 0, TEST_STYLE_MODULE_FILE );