我正在尝试创建一个简单的矩阵以在我的着色器中使用(OpenGL 3.x 的新功能),但是,我收到了来自 GLM 的错误。
这是我尝试做的一件事:
glm::mat4 scaleMatrix = glm::scale(2.0f, 2.0f, 2.0f);
Run Code Online (Sandbox Code Playgroud)
不幸的是,编译器(MinGW)给了我错误:
error: no matching function for call to 'scale(float, float, float)'
candiate is:
template<class T, glm::precision P> glm::detail::tmat4x4<T, P> glm::scale(const
glm::detail::tmat4x4<T, P>&, const glm::detail::tvec3<T, P>&)
Run Code Online (Sandbox Code Playgroud)
当我单击 IDE 中的错误时,它会将我带到下面“matrix_transform.inl”中的第一行:
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale
(
detail::tmat4x4<T, P> const & m,
detail::tvec3<T, P> const & v
)
Run Code Online (Sandbox Code Playgroud)
为什么我收到这个错误?
String data = line.split(":")[1];
String location = data.split("|")[0];
String type = data.split("|")[1];
System.out.println("D: " + type);
int x = Integer.parseInt(location.split("-")[0]);
int y = Integer.parseInt(location.split("-")[1]);
int t = Integer.parseInt(type);
Run Code Online (Sandbox Code Playgroud)
输入此解析器的原始字符串格式为"DATA:3,3 | 1".我正在尝试将其解析为"DATA:x,y| t" 的格式.问题是location当字符串从字符串中分离时,该字符串是空白的data.为什么?
我正在尝试在OpenGL上学习本教程,而不是加载原始图像我正在使用lodePNG.
问题是,当我使用函数glTexImage2D时,我在最后一个参数上得到一个错误,它只需要一个GLvoid*变量.LodePNG仅输出std :: vector作为最终图像数据.我在这个问题上找不到任何其他资源.
我如何才能使这个功能起作用?该错误只是表明它不采用这种数据类型.
基本上,如果我有类A,A类持有类的实例B,而无需使用new,我创建一个类的实例A使用new.类中B的类实例是否A存储在堆栈或堆中?