openframeworks / openframeworks/openFrameworks

Error passing glm:ivec as a parameter after updating to of_v0.12.0_vs_release

Open
#7,676 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

We've been having issues when passing glm:ivec as a parameter after updating to of_v0.12.0_vs_release

I made this very simple app which demonstrates the issue
glmivecbug.zip

It has a module with just this code

#include "glm/glm.hpp"
#include <iostream>

void testglm(glm::ivec2 v) {
	std::cout << v.x << "," << v.y << std::endl;
}

and its called from ofApp::setup like this

glm::ivec2 v = { 100, 100 };
testglm(v);

Instead of seeing 100,100 on the console I see 1372696,0

If I include ofMain.h instead of glm/glm.hpp in glmtest.cpp it works OK and I see 100,100 on the console but that would be very undesirable for us.

So, I guess the question is, "what includes do I need to be able to use glm vectors in a module without openframeworks includes?"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached glmivecbug.zip, then inspect the module's glmtest.cpp and the call from ofApp::setup. Compare the behavior when glm/glm.hpp and ofMain.h are included, run the minimal app, and consider the issue resolved when passing glm::ivec2 prints 100,100 without requiring openFrameworks includes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.