提问人:Rass 提问时间:11/17/2023 最后编辑:BDLRass 更新时间:11/17/2023 访问量:70
如何在 VSCode 中使用 irun opengl [已关闭]
how do irun opengl in vscode [closed]
问:
所以我想在 VSCode 中运行我的 OpenGL 代码
using System;
using System.ComponentModel;
using System.Resources;
using OpenGL;
using Tao;
using Tao.FreeGlut;
class Display
{
private static void Main()
{
Glut.glutInit();
Glut.glutInitWindowSize(1200,720);
Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE|Glut.GLUT_DEPTH);
Glut.glutCreateWindow("game");
Glut.glutIdleFunc(onrenderframe);
Glut.glutDisplayFunc(ondisplay);
Glut.glutMainLoop();
}
private static void onrenderframe()
{
Gl.Viewport(0,0,1200,720);
Gl.Clear(ClearBufferMask.ColorBufferBit|ClearBufferMask.DepthBufferBit);
Glut.glutSwapBuffers();
}
private static void ondisplay()
{
}
}
我的launch.json `
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}
我的 CodeRunner 设置
"csharp": "cd $dir && dotnet run $fileName",
我的 SLN 文件
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "code", "code.csproj", "{9276B0DA-3EB9-4219-BF1D-8D322365B91E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9276B0DA-3EB9-4219-BF1D-8D322365B91E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9276B0DA-3EB9-4219-BF1D-8D322365B91E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9276B0DA-3EB9-4219-BF1D-8D322365B91E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9276B0DA-3EB9-4219-BF1D-8D322365B91E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2F3D7ECF-D34C-498A-92F7-3371505D719A}
EndGlobalSection
EndGlobal
我的 CSPROJ 文件
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>c_</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
所以我尝试像往常一样运行它,但它不起作用,它说 C:\Program Files\dotnet\sdk\7.0.403\Microsoft.Common.CurrentVersion.targets(3327,5):错误 MSB3822:非字符串资源需要系统 .Resources.Extensions 程序集,但在此项目的引用中找不到它。[F:\code\c#\code.csproj]
我是否必须在设置中调整一些yyhing才能工作,我是OpenGL编程和编程本身的新手,请帮助我
答: 暂无答案
评论