-2

I have been able to get the window to render, Im pretty sure my shader is working, and I can fetch the Image from my assets, however when I actually render the view I just get my blue background and no sprite shows up.

Basic design is as follows:

Views inherit the abstract class WindowBase, which has most of the heavy lifting in it and declares a Shader (I only have one right now in Assets). My only view right now is just Main.cs

I can then Declare ObjectBase instances in a View. Objects have Animations composed of Sprites which are linked to Textures generated by the Texture Service via OpenGL.

There's also an input service that doesnt do much yet, though I do have it bound to Escape Key to close the window right now. But I doubt that part of the program is linked to this problem.

Update: Piece by piece, I slowly converted the original to mine and found it broke as soon as I swapped to my Shader system, so the issue lies within there. I'll post my code vs their's here:

Their Shader class

My version

I'm guessing at this point I must've typo'd somewhere. Or one of my loops just isn't compatible. Perhaps the way I'm handling my streamreader in the Assets Class?

  • 2
    Don't just dump all you code, [create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – vallentin Apr 09 '17 at 15:06
  • This is OpenGL, I'm really not certain if there is a way I can simplify what I have. It's an entire game engine, and it's not rendering sprites. There's like... 8 different places it could be breaking in. However the code you want to look at is in Views/Main.cs. – Steffen Cole Blake Apr 09 '17 at 18:12

1 Answers1

0

Solved it: My problem was on line 114, I had the following code:

    public int Attribute(string name)
    {
        return _attributes.ContainsKey(name) ? _attributes[name].Address : -1;
    }

    public int Uniform(string name)
    {
        return _uniforms.ContainsKey("name") ? _uniforms[name].Address : -1;
    }

    public uint Buffer(string name)
    {
        return _buffers.ContainsKey(name) ? _buffers[name] : 0;
    }

As follows:

_uniforms.ContainsKey("name") should be _uniforms.ContainsKey(name)