Author Topic: OpenGL won't work on netbook PC  (Read 15344 times)

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL won't work on netbook PC
« Reply #15 on: 2011-02-17, 09:02:01 PM »
If I do all this, I hope there's still someone around to test that my fix worked.  I think I should handle both absence of support for GL_ARB_texture_rectangle and NPOTS textures.  It shouldn't be too hard because My texture is already a wrapper class, which I implemented as I converted from DirectX to OpenGL.

Wyzemann

  • Regular
  • **
  • Posts: 26
    • View Profile
Re: OpenGL won't work on netbook PC
« Reply #16 on: 2011-02-18, 09:30:02 AM »
If you have anything you would like to test on my netbook just send me an e-mail and I would be glad to do it.

Chris

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL won't work on netbook PC
« Reply #17 on: 2011-02-20, 12:59:40 PM »
If my test is correct, the solution is shockingly simple.  To anyone who was having problems with SGDK2 on OpenGL, can you run the following test for me?

1. Create or load a sample project in the IDE (you can do this without going into the map editior).
2. Replace the contents of the Display.cs file in the project's SourceCode folder with the contents of the attached Display.cs file.
3. Run the project

Let me know if that works.

Edit: Attachment removed in favor of updated version below.
« Last Edit: 2011-02-21, 08:55:06 PM by bluemonkmn »

Wyzemann

  • Regular
  • **
  • Posts: 26
    • View Profile
Re: OpenGL won't work on netbook PC
« Reply #18 on: 2011-02-20, 05:55:42 PM »
I tried the following procedure, and it failed.
I downloaded the Alpha and Omega project.
Under the File menu, I selected "Generate project" and ran the project. As expected, the texture rectangle could not be found.

Then I replaced the display.cs text with the text from the attached file, and saved the project.
Again I generated the project and ran the project (Ctrl+F5)

An error message appears:
Note I will truncate file paths with ... for brevity's sake. The files are in their default locations.

Error
A fatal error occurred initializing or running the game:
at Display.CheckError() in
... \Display.cs:line 885  

at Display.Flush() in
... \Display.cs:line524

at GameForm.Run() in
... GameForm.cs:line 243

at Project.Main()
... Project.cs:line 107

Line 885 of display.cs is:
throw new System.Exception(ec.ToString());

I attempted to invoke a message box to see the contents of ec but it didn't work because it could not be converted to a string.
I am a rank beginner when it comes to programming in C. Perhaps this is an array and I will need to loop through it.

In bypassing the error code I was able to get into the game. The sprites seemed to work but there were many blank tiles, including
text tiles.

Chris
« Last Edit: 2011-02-20, 06:21:13 PM by Wyzemann »

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL won't work on netbook PC
« Reply #19 on: 2011-02-21, 08:07:36 AM »
Can you use the suggested sample project instead of downloading a project?  I don't expect the results will be much better, but I just want to be sure of what is being tested.  Just select New->Sample Project from the file menu.

How did you "bypass the error code"?
Did some sprites appear as they should?

I wonder if the problem is that your driver also doesn't support graphic sheets (textures) whose size is not a power of two.  That would probably also be an easy fix.
The ec variable is already being converted to a string and displayed in the error message you copied, but either you missed a piece or the error message was empty.  The message comes immediately after the text "running the game:" and before the first "at".

Wyzemann

  • Regular
  • **
  • Posts: 26
    • View Profile
Attached output
« Reply #20 on: 2011-02-21, 09:36:26 AM »
I didn't realize there was an official sample game. Sorry about that.
This time I used winspy to capture the text from the message box. I truncated the paths to "..." for brevity's sake:

A fatal error occurred initializing or running the game:
System.Exception: InvalidValue

   at Display.CheckError() in ...\Display.cs:line 885
   at Display.DrawFrame(TextureRef texture, Rectangle sourceRect, PointF[] corners, Int32 offsetX, Int32 offsetY)
   in ...\Display.cs:line 486
   
   at LayerBase.Draw() in ...\LayerBase.cs:line 423
   at Menu_Map.Draw() in ...\Menu_Map.cs:line 78
   at MapBase.DrawAllViews() in ...\MapBase.cs:line 269
   at GameForm.Run() in ...\GameForm.cs:line 227
   at Project.Main() in ...\Project.cs:line 107


Attached is a screenshot from the game. I "bypassed" the error by removing line 885 and running in debug mode.
The sprites are animating and a lot of it seems to be working. As you can see it is missing tiles, including the text tiles, which might have something to do with this error.

Note my netbook's screen resolution is too small to get the whole thing (1024 x 600).

Hope this helps

Chris

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL won't work on netbook PC
« Reply #21 on: 2011-02-21, 03:50:39 PM »
Oh wow!  This is promising.  It looks like text is the only thing that failed.  I will look into this more when I get home today (I hope).

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL won't work on netbook PC
« Reply #22 on: 2011-02-21, 08:55:47 PM »
OK, try this version of Display.cs.

Wyzemann

  • Regular
  • **
  • Posts: 26
    • View Profile
Re: OpenGL won't work on netbook PC
« Reply #23 on: 2011-02-22, 08:27:08 AM »
Looks like that worked. I also "Generated" the project and ran the .exe and there were no issues that I could see.
In debug mode however was a very minor glitch. There was some slight pixel garbling in the black tile between the words CONTINUE and GAME in the first screen, but it only occurred in the debug mode, not when it ran from its own exe. I attempted a screen capture, but it was invisible to the screen capture. Maybe it's just because I have a piece of junk video board.

Thanks for working on this way cool software. I'm looking forward to seeing this implemented in the level editor.

Chris

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL won't work on netbook PC
« Reply #24 on: 2011-02-23, 05:44:41 AM »
Hooray -- I will begin updating the SGDK2 IDE to match and release another version soon.  Maybe I can get the improved error handling in there too while I'm at it.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL won't work on netbook PC
« Reply #25 on: 2011-02-27, 12:05:54 PM »
Can you try http://sgdk2.enigmadream.com/support/SGDK219.zip and let me know if it works on your netbook before I publicly release it?  (Anyone who had problems with OpenGL when the DirectX version of SGDK2 worked, I'd appreciate your replies.)

Also, durnurd, did your change for tracking down errors in sprite and plan rules work for cases when the project was compiled to a temporary location, or only when it was compiled to real files in the project directory?

Wyzemann

  • Regular
  • **
  • Posts: 26
    • View Profile
Re: OpenGL won't work on netbook PC
« Reply #26 on: 2011-02-27, 02:10:00 PM »
It appears to be running successfully and the level editor worked without any flaws. It is working very nicely.
I do have more information about the pixel garbling bug on the startup screen that I mentioned earlier.

I assumed the problem was something outside of the OS, but I found it didn't capture because it was blinking very rapidly. After multiple attempts I was successful at at capturing. I notice the strange blinking block changed the next time I loaded it.
The first attachment is a screenshot from the first launch from the game's compiled .exe file.

The second attachment is a compilation. I cut out the block for the subsequent two runs. (There could have been another run I missed) and pasted them so you you see two of them, each on subsequent runs, presented with what appeared to be the last tile shown for runs afterward.

I actually recompiled and did a few more trying to look for a pattern, but different blocks appeared. Some of them look like game tiles. Sometimes they were not there at all. It looks like it is getting some kind of graphic data from different places and is displaying it on that tiny block.

Like I said before, it only happens on this screen and does not seem to interfere with anything. But I did say it did not apply to the generated exe file. This was inaccurate, as it does manifest both with SGDK running in addition to it and without as I discovered.

With that being said, I did try two other games, including Alpha and Omega, and the Turret demo and did not run into this problem. It may be unique to your sample game.

Anyway I am confident enough to begin work on my own game. Keep up the good work.

Chris

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: OpenGL won't work on netbook PC
« Reply #27 on: 2011-02-27, 11:14:35 PM »
I think the change I made relied on filenames somewhat, so temporary files wouldn't work.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL won't work on netbook PC
« Reply #28 on: 2011-02-28, 06:21:29 AM »
Now that I see exactly what you mean about the position of the corruption, I think I realize what's going on.  There's an error in the design of the menu map.  Fortunately not a problem with SGDK2 itself.  Here's how you can fix it if you care to test it:
1. Open the "Disabled Continue" layer of the "Menu" map in the editor.
2. From the "Layers" menu un-check the "Letters" layer to hide the main layer.
3. "Continue Game" appears in gray in the top corner.  Move the mouse between the words.
4. Notice the status bar says Tile @X,Y: 0.  That means the transparent tile is at that position.
5. From the tile selector, select the last tile (#207).
6. Click between the words to change the tile #0 to tile #207.

Now when you run the game you should not see the corruption any more.  The cause of that behavior was that "Continue Game" got copied to the main layer as the game was starting, and since the transparent tile overwrote the black tile on the main layer when that happened, there was never any opaque tile there to erase whatever was in video memory at that location.

Thanks for helping me get SGDK2 to be more compatible with other video hardware.  I hope everyone who had problems with the OpenGL version will give it another chance now.  I wish I had realized earlier that it would be so easy.

I'm going to see if I can do anything about improving that error reporting before truly releasing 2.1.9.

Wyzemann

  • Regular
  • **
  • Posts: 26
    • View Profile
Re: OpenGL won't work on netbook PC
« Reply #29 on: 2011-02-28, 09:47:11 AM »
That fixed it.

Right now I'm making models in Blender 3d to render to 2d and learning how to rig meshes for animation, which for me is more of a learning curve than I expected. So it will probably be some time before I get into the game engine other than playing around with it. If I don't get back in a day or two please feel free to e-mail me if you would like me to do any further tests.

Chris