Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support OpenGL GTK3 New API#25822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
asmorkalov merged 10 commits intoopencv:4.xfrommqcmd196:gtk3-gl-support
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Warnings fix.
  • Loading branch information
@asmorkalov
asmorkalov committedJul 15, 2024
commitc76cdb46cf1343866869b757f5c38c108cfeff18
3 changes: 0 additions & 3 deletionsmodules/highgui/CMakeLists.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -326,9 +326,6 @@ if(HIGHGUI_ENABLE_PLUGINS)
ocv_target_compile_definitions(${the_module} PRIVATE ENABLE_PLUGINS)
if(TARGET opencv_test_highgui)
ocv_target_compile_definitions(opencv_test_highgui PRIVATE ENABLE_PLUGINS)
if(OPENGL_LIBRARIES)
ocv_target_link_libraries(opencv_test_highgui ${OPENGL_LIBRARIES})
endif()
endif()
endif()

Expand Down
6 changes: 4 additions & 2 deletionsmodules/highgui/src/window_gtk.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -914,13 +914,15 @@ namespace

#ifdef GTK_VERSION3

void glRealizeCallback(GtkGLArea* area, gpointer user_data){
void glRealizeCallback(GtkGLArea* area, gpointer user_data) {
CV_UNUSED(user_data);
gtk_gl_area_make_current(area);
if (gtk_gl_area_get_error(area) != NULL)
CV_Error(cv::Error::OpenGlApiCallError, "OpenGL context is not initialized");
}

gboolean glRenderCallback(GtkGLArea* area, GdkGLContext* context, gpointer user_data){
gboolean glRenderCallback(GtkGLArea* area, GdkGLContext* context, gpointer user_data) {
CV_UNUSED(context);
CvWindow* window = (CvWindow*)user_data;
gtk_gl_area_make_current(area);
if (gtk_gl_area_get_error(area) != NULL) {
Expand Down
6 changes: 3 additions & 3 deletionssamples/opengl/opengl3_2.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,7 +33,7 @@ struct DrawData
GLuint vao, vbo, program, textureID;
};

cv::Mat rot(float angle)
staticcv::Mat rot(float angle)
{
cv::Mat R_y = (cv::Mat_<float>(4,4) <<
cos(angle), 0, sin(angle), 0,
Expand All@@ -51,7 +51,7 @@ static GLuint create_shader(const char* source, GLenum type) {
return shader;
}

void draw(void* userdata){
staticvoid draw(void* userdata){
DrawData* data = static_cast<DrawData*>(userdata);
static float angle = 0.0f;
angle += 1.f;
Expand All@@ -75,7 +75,7 @@ int main(int argc, char* argv[])
if (argc < 2)
{
cout << "Usage: " << argv[0] << " image" << endl;
filename = "HappyFish.jpg";
filename = "baboon.jpg";
}
else
filename = argv[1];
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp