Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
2a4fb155
Commit
2a4fb155
authored
Nov 28, 2011
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added OpenGL support to Gtk realization of highgui
parent
fb2fad52
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
3 deletions
+34
-3
CMakeLists.txt
CMakeLists.txt
+15
-3
precomp.hpp
modules/highgui/src/precomp.hpp
+5
-0
window.cpp
modules/highgui/src/window.cpp
+6
-0
window_gtk.cpp
modules/highgui/src/window_gtk.cpp
+0
-0
point_cloud.cpp
samples/cpp/point_cloud.cpp
+8
-0
No files found.
CMakeLists.txt
View file @
2a4fb155
...
@@ -507,6 +507,17 @@ if(UNIX)
...
@@ -507,6 +507,17 @@ if(UNIX)
if
(
WITH_GTK
)
if
(
WITH_GTK
)
CHECK_MODULE
(
gtk+-2.0 HAVE_GTK
)
CHECK_MODULE
(
gtk+-2.0 HAVE_GTK
)
CHECK_MODULE
(
gthread-2.0 HAVE_GTHREAD
)
CHECK_MODULE
(
gthread-2.0 HAVE_GTHREAD
)
if
(
WITH_OPENGL
)
CHECK_MODULE
(
gtkglext-1.0 HAVE_GTKGLEXT
)
if
(
HAVE_GTKGLEXT
)
find_package
(
OpenGL QUIET
)
if
(
OPENGL_FOUND
)
set
(
HAVE_OPENGL 1
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
OPENGL_LIBRARIES
}
)
include_directories
(
${
OPENGL_INCLUDE_DIR
}
)
endif
()
endif
()
endif
()
else
()
else
()
set
(
HAVE_GTK FALSE
)
set
(
HAVE_GTK FALSE
)
set
(
HAVE_GTHREAD FALSE
)
set
(
HAVE_GTHREAD FALSE
)
...
@@ -1125,10 +1136,10 @@ if(WIN32)
...
@@ -1125,10 +1136,10 @@ if(WIN32)
endif
()
endif
()
endif
()
endif
()
if
(
WITH_OPENGL AND NOT HAVE_QT_OPENGL
)
if
(
WITH_OPENGL AND NOT HAVE_QT_OPENGL
)
find_package
(
OpenGL QUIET
)
find_package
(
OpenGL QUIET
)
if
(
OPENGL_FOUND
)
if
(
OPENGL_FOUND
)
set
(
HAVE_OPENGL 1
)
set
(
HAVE_OPENGL 1
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
OPENGL_LIBRARIES
}
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
OPENGL_LIBRARIES
}
)
include_directories
(
${
OPENGL_INCLUDE_DIR
}
)
include_directories
(
${
OPENGL_INCLUDE_DIR
}
)
...
@@ -1725,7 +1736,8 @@ else()
...
@@ -1725,7 +1736,8 @@ else()
endif
()
endif
()
else
()
else
()
status
(
" GTK+ 2.x:"
HAVE_GTK THEN YES ELSE NO
)
status
(
" GTK+ 2.x:"
HAVE_GTK THEN YES ELSE NO
)
status
(
" GThread:"
HAVE_GTHREAD THEN YES ELSE NO
)
status
(
" GThread :"
HAVE_GTHREAD THEN YES ELSE NO
)
status
(
" GtkGlExt:"
HAVE_GTKGLEXT THEN YES ELSE NO
)
endif
()
endif
()
endif
()
endif
()
endif
()
endif
()
...
...
modules/highgui/src/precomp.hpp
View file @
2a4fb155
...
@@ -186,8 +186,13 @@ double cvGetModeWindow_GTK(const char* name);
...
@@ -186,8 +186,13 @@ double cvGetModeWindow_GTK(const char* name);
double
cvGetModeWindow_CARBON
(
const
char
*
name
);
double
cvGetModeWindow_CARBON
(
const
char
*
name
);
double
cvGetPropWindowAutoSize_W32
(
const
char
*
name
);
double
cvGetPropWindowAutoSize_W32
(
const
char
*
name
);
double
cvGetPropWindowAutoSize_GTK
(
const
char
*
name
);
double
cvGetRatioWindow_W32
(
const
char
*
name
);
double
cvGetRatioWindow_W32
(
const
char
*
name
);
double
cvGetRatioWindow_GTK
(
const
char
*
name
);
double
cvGetOpenGlProp_W32
(
const
char
*
name
);
double
cvGetOpenGlProp_W32
(
const
char
*
name
);
double
cvGetOpenGlProp_GTK
(
const
char
*
name
);
//for QT
//for QT
#if defined (HAVE_QT)
#if defined (HAVE_QT)
...
...
modules/highgui/src/window.cpp
View file @
2a4fb155
...
@@ -109,6 +109,8 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
...
@@ -109,6 +109,8 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
return
cvGetPropWindow_QT
(
name
);
return
cvGetPropWindow_QT
(
name
);
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
return
cvGetPropWindowAutoSize_W32
(
name
);
return
cvGetPropWindowAutoSize_W32
(
name
);
#elif defined (HAVE_GTK)
return
cvGetPropWindowAutoSize_GTK
(
name
);
#else
#else
return
-
1
;
return
-
1
;
#endif
#endif
...
@@ -120,6 +122,8 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
...
@@ -120,6 +122,8 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
return
cvGetRatioWindow_QT
(
name
);
return
cvGetRatioWindow_QT
(
name
);
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
return
cvGetRatioWindow_W32
(
name
);
return
cvGetRatioWindow_W32
(
name
);
#elif defined (HAVE_GTK)
return
cvGetRatioWindow_GTK
(
name
);
#else
#else
return
-
1
;
return
-
1
;
#endif
#endif
...
@@ -130,6 +134,8 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
...
@@ -130,6 +134,8 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
#if defined (HAVE_QT)
#if defined (HAVE_QT)
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
return
cvGetOpenGlProp_W32
(
name
);
return
cvGetOpenGlProp_W32
(
name
);
#elif defined (HAVE_GTK)
return
cvGetOpenGlProp_GTK
(
name
);
#else
#else
return
-
1
;
return
-
1
;
#endif
#endif
...
...
modules/highgui/src/window_gtk.cpp
View file @
2a4fb155
This diff is collapsed.
Click to expand it.
samples/cpp/point_cloud.cpp
View file @
2a4fb155
...
@@ -214,6 +214,8 @@ int main(int argc, const char* argv[])
...
@@ -214,6 +214,8 @@ int main(int argc, const char* argv[])
while
(
true
)
while
(
true
)
{
{
int
key
=
waitKey
(
1
);
int
key
=
waitKey
(
1
);
if
(
key
>=
0
)
key
=
key
&
0xff
;
if
(
key
==
27
)
if
(
key
==
27
)
break
;
break
;
...
@@ -221,7 +223,13 @@ int main(int argc, const char* argv[])
...
@@ -221,7 +223,13 @@ int main(int argc, const char* argv[])
double
aspect
=
getWindowProperty
(
"OpenGL Sample"
,
WND_PROP_ASPECT_RATIO
);
double
aspect
=
getWindowProperty
(
"OpenGL Sample"
,
WND_PROP_ASPECT_RATIO
);
const
double
posStep
=
0.1
;
const
double
posStep
=
0.1
;
#ifdef _WIN32
const
double
mouseStep
=
0.001
;
const
double
mouseStep
=
0.001
;
#else
const
double
mouseStep
=
0.000001
;
#endif
const
int
mouseClamp
=
300
;
const
int
mouseClamp
=
300
;
camera
.
setPerspectiveProjection
(
30.0
+
fov
/
100.0
*
40.0
,
aspect
,
0.1
,
1000.0
);
camera
.
setPerspectiveProjection
(
30.0
+
fov
/
100.0
*
40.0
,
aspect
,
0.1
,
1000.0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment