minor fix
authorVladislav Vinogradov <no@email>
Mon, 28 Nov 2011 12:10:37 +0000 (12:10 +0000)
committerVladislav Vinogradov <no@email>
Mon, 28 Nov 2011 12:10:37 +0000 (12:10 +0000)
modules/highgui/src/window.cpp
modules/highgui/src/window_gtk.cpp
modules/highgui/src/window_w32.cpp

index bf241e4..2ee6d3f 100644 (file)
@@ -609,21 +609,6 @@ void cv::clearTextOpenGl(const string& winname)
     cvClearTextOpenGl(winname.c_str());
 }
 
-#if (!defined WIN32 && !defined _WIN32) || defined HAVE_QT
-
-CV_IMPL void cvAddTextOpenGl(const char*, const char*, CvPoint, CvScalar, const char*, int, int, int)
-{
-    CV_Error(CV_OpenGlNotSupported, "This function works only under WIN32");
-}
-
-CV_IMPL void cvClearTextOpenGl(const char*)
-{
-    CV_Error(CV_OpenGlNotSupported, "This function works only under WIN32");
-}
-
-#endif //  (!defined WIN32 && !defined _WIN32) || defined HAVE_QT
-
-
 // Without OpenGL
 
 #ifndef HAVE_OPENGL
index 2532454..94a8fe4 100644 (file)
@@ -1142,6 +1142,75 @@ CV_IMPL void cvSetOpenGlContext(const char* name)
     __END__;
 }
 
+CV_IMPL void cvAddTextOpenGl(const char* name, const char* text, CvPoint org, CvScalar color, const char* fontName, int fontHeight, int fontWeight, int fontStyle)
+{
+    CV_FUNCNAME( "cvAddTextOpenGl" );
+    
+    __BEGIN__;
+    CV_ERROR( CV_OpenGlNotSupported, "Not Implemented" );
+    __END__;
+    
+    /*__BEGIN__;
+
+    CvWindow* window;
+
+    if(!name)
+        CV_ERROR( CV_StsNullPtr, "NULL name string" );
+
+    window = icvFindWindowByName( name );
+    if (!window)
+        CV_ERROR( CV_StsNullPtr, "NULL window" );
+
+    if (!window->useGl)
+        CV_ERROR( CV_OpenGlNotSupported, "Window doesn't support OpenGL" );
+
+    if (!wglMakeCurrent(window->dc, window->hGLRC))
+        CV_ERROR( CV_OpenGlApiCallError, "Can't Activate The GL Rendering Context" );
+
+    if (!window->glText)
+        window->glText = new OpenGlText(window->dc);
+
+    window->glText->add(text, org, color, fontName, fontHeight, fontWeight, fontStyle);
+
+    InvalidateRect(window->hwnd, 0, 0);
+
+    __END__;*/
+}
+
+CV_IMPL void cvClearTextOpenGl(const char* name)
+{
+    CV_FUNCNAME( "cvClearTextOpenGl" );
+    
+    __BEGIN__;
+    CV_ERROR( CV_OpenGlNotSupported, "Not Implemented" );
+    __END__;
+    
+    /*__BEGIN__;
+
+    CvWindow* window;
+
+    if(!name)
+        CV_ERROR( CV_StsNullPtr, "NULL name string" );
+
+    window = icvFindWindowByName( name );
+    if (!window)
+        CV_ERROR( CV_StsNullPtr, "NULL window" );
+
+    if (!window->useGl)
+        CV_ERROR( CV_OpenGlNotSupported, "Window doesn't support OpenGL" );
+
+    if (!wglMakeCurrent(window->dc, window->hGLRC))
+        CV_ERROR( CV_OpenGlApiCallError, "Can't Activate The GL Rendering Context" );
+
+    if (window->glText)
+    {
+        window->glText->clear();
+        InvalidateRect(window->hwnd, 0, 0);
+    }
+
+    __END__;*/
+}
+
 CV_IMPL void cvUpdateWindow(const char* name)
 {
     CV_FUNCNAME( "cvUpdateWindow" );
index 00a810f..e6afcc3 100644 (file)
@@ -1268,7 +1268,7 @@ CV_IMPL void cvSetOpenGlContext(const char* name)
 
 CV_IMPL void cvAddTextOpenGl(const char* name, const char* text, CvPoint org, CvScalar color, const char* fontName, int fontHeight, int fontWeight, int fontStyle)
 {
-    CV_FUNCNAME( "cvSetOpenGlContext" );
+    CV_FUNCNAME( "cvAddTextOpenGl" );
 
     __BEGIN__;
 
@@ -1299,7 +1299,7 @@ CV_IMPL void cvAddTextOpenGl(const char* name, const char* text, CvPoint org, Cv
 
 CV_IMPL void cvClearTextOpenGl(const char* name)
 {
-    CV_FUNCNAME( "cvSetOpenGlContext" );
+    CV_FUNCNAME( "cvClearTextOpenGl" );
 
     __BEGIN__;