Question

Garry Grierson on Sat, 07 May 2016 00:43:28


The machine was already loaded with, Windows XP Service pack 3, .Net 4, and Microsoft Visual C# 2010 Express with XNA. The on-board graphics card only goes as far as OpenGL 1.4

I believe MonoGame 2.5.x works with OpenGL 1.x so I added the following, in order: GTK 2.12.9-2.win32 -> MonoDevelop 2.8.6.5 -> MonoGame 2.5.1.0

Visual C# 2010 Express now showed the Linux and Windows mono game solution options.
However, when I first tried to compile the standard mono game for windows template it complained at 'public Game1() : base()'

It appeared that OpenTK 1.1.0.0 was installed by default in the References, and it threw an error with this, so I replaced it with OpenTK 1.0.0.0 and it got past this error.
Next it complained at the same point in the code that openal32 wasn't found, so I placed an openal32.dll file in the project folder, and it got past this error.

Then it threw an error at 'spriteBatch = new SpriteBatch(GraphicsDevice);'
The error was 'Unable to find an entry point named 'glCreateShader' in DLL 'opengl32.dll'.

When I put an opengl32.dll file in the project folder it gave a 'The type initializer for 'OpenTK.Platform.Windows.WinGLContext' threw an exception' error back at the ' public Game1() :base()' command.

I thought this may be because the graphics card can only do OpenGL 1.4, but Mono Game 2.5 should use OpenGL 1. So any idea where this is coming from?

Can this be a problem with the openal32.dll opengl32.dll file versions I put in the project folder?

And why do so much things seem to be the wrong versions?




Replies

Garry Grierson on Sat, 07 May 2016 21:40:56


I thought I'd mention that OpenTK 1.1.x was already on this machine, along with XNA.

Visual studio 2010 express projects written to use OpenTK 1.1.x directly, without the MonoGame libraries, work fine.

Garry Grierson on Sat, 07 May 2016 21:52:31


Just to be clear - this is happening with the basic 'new project' boilerplate code e.g

#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.GamerServices;
#endregion

namespace MonoGameWindowsApplication2
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game1 : Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;

        public Game1()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
        }

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
        }

        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }

        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
                Exit();

            // TODO: Add your update logic here

            base.Update(gameTime);
        }

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
    }
}

SeanMcDev on Wed, 18 May 2016 21:43:32


You're on the wrong forum.