Files
Vivid2DRenderer/Vivid2D/Vivid2D.cpp
2025-11-14 16:22:42 +08:00

38 lines
1.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Vivid2D.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
// 包含GLM主头文件
#include <glm/glm.hpp>
// 包含vec2定义
#include <iostream>
#include <glm/vec2.hpp>
int main() {
// 创建一个二维浮点向量 (Vector2f)
glm::vec2 position(100.0f, 200.0f);
// 创建另一个向量代表速度
glm::vec2 velocity(5.0f, -2.0f);
// 向量加法,更新位置
position += velocity;
// 输出新的位置
// GLM的向量可以直接用std::cout输出但需要包含<glm/gtx/string_cast.hpp>
// 这里为了简单,我们手动输出
std::cout << "New Position: (" << position.x << ", " << position.y << ")" << std::endl;
return 0;
}
// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
// 调试程序: F5 或调试 >“开始调试”菜单
// 入门使用技巧:
// 1. 使用解决方案资源管理器窗口添加/管理文件
// 2. 使用团队资源管理器窗口连接到源代码管理
// 3. 使用输出窗口查看生成输出和其他消息
// 4. 使用错误列表窗口查看错误
// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目
// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件