我正在构建一个icosphere,我已经得到了代码的绘制部分,但我一直得到一个NullReferenceException是未处理的错误.我知道它指的是哪些代码,但我不知道实际上是什么错误或如何解决它.
这是类代码:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace Icosahedron_Test
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Camera camera;
VertexPositionColor[] verts;
VertexBuffer vertexBuffer;
BasicEffect effect;
Matrix worldTranslation = Matrix.Identity;
Matrix worldRotation = Matrix.Identity;
int radius = 1; //planet radius
int refinement = 2; // number of times to refine …Run Code Online (Sandbox Code Playgroud) 可能重复:
使用jQuery检测IE
你好,
我试图弄清楚如何在页面加载时检测浏览器类型,然后,如果浏览器是Internet Explorer,则创建一个警告框,告诉用户他们必须允许我的库的脚本工作.
我知道我需要使用$ jquery.support来完成这个,但我不知道语法,或者如何在页面加载完成后只执行一次.有没有办法我可以为页面创建一个cookie,说他们收到了警告,这样他们每次进入我的主页都不会收到警告?
提前致谢.