Author Topic: SGDK 2.1 - OpenGL Support  (Read 295604 times)

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #45 on: 2008-09-26, 05:33:06 AM »
Hey, I just realized/remembered, .NET 2.0 and later comes with an MSBuild utility so I think that will make the command line build process much simpler.  Can anyone else test this for me on a system that doesn't (or does, whatever) have a C# development environment installed?  Go to the directory where all the SGDK 2.1 source code is and run the following command:

C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe

You don't even need to pass any command line arguments.  It will find the .SLN file in the current directory and compile it.  If you don't have a v3.5 directory, try installing .NET Framework 3.5 (from Windows Update?).

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: SGDK 2.1 - OpenGL Support
« Reply #46 on: 2008-09-26, 09:18:47 AM »
So... are you actually using .NET 3.5 now?  I tried it with 2.0 and it didn't work (bad sln file format version).

I couldn't open it in the VS IDE either.  When I opened the .csproj file alone in the IDE, it worked fine.  After adding the Reflect project, downloading OpenTK and extracting the two DLLs into the directory, and changing all the "var"s to the real variable type, it compiled and ran in the IDE just fine.

Also, after looking at the current implementation, obviously, you will eventually change the need for "CoolFont".  Other suggestions that you may or may not have already planned, based on what I've worked with on cellphone games:

1. A function/property "(Set/Get)CharSet" which takes a string defining what characters are in the image in what order.
2. A function/property "(Set/Get)TextColor" which can change the color of the font, since the drawing is using graphic sheets instead of framesets.
3. Possibly similar functionality for scaling, for the same reason?
3. Determine the base character size by image cell size

In our framework at work, DrawString actually takes in an X, Y, String, and an anchor, which is a logical OR on some flags: TOP, VERTICAL_CENTER, BASELINE, BOTTOM, LEFT, HORIZONTAL_CENTER, and RIGHT.  The anchors correspond to what the X and Y are actually pointing at (the BOTTOM HORIZONTAL_CENTER of the text for example).  It then offsets the x and y based on how big it calculates the string to be based on those flags.

There's also another function, DrawStringInRect, which takes in the string, a rectangle, and anchors.  The rectangle defines what rectangle to stay inside.  Again, the anchors can center the text within the rectangle, or right-align it or whatever.

Of course, you couldn't really fit any of those into one call with three parameters.  Unless you did that visual editor idea with the attributes thing, which would then have one parameter be the whole rectangle.
« Last Edit: 2008-09-26, 09:53:15 AM by durnurd »
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: SGDK 2.1 - OpenGL Support
« Reply #47 on: 2008-09-27, 08:39:02 AM »
So... are you actually using .NET 3.5 now?  I tried it with 2.0 and it didn't work (bad sln file format version).

The project uses the latest version of the C# development environment, but targets .NET framework 2.0, so I think you need .NET 3.5 to compile the project, but only 2.0 to run it.

Also, after looking at the current implementation, obviously, you will eventually change the need for "CoolFont".

Why is that obvious?  I was thinking about leaving that in as the default font, allowing users to change it, but not delete it (if they plan to be doing any text output).  I don't prevent them from deleting it; you'll just get an error message if you try to output text and have deleted it from your project without replacing it appropriately with something else.

1. A function/property "(Set/Get)CharSet" which takes a string defining what characters are in the image in what order.

I already have "SetMessageFont" which allows you to change the font used for messages by specifying an alternate tileset.

2. A function/property "(Set/Get)TextColor" which can change the color of the font, since the drawing is using graphic sheets instead of framesets.
3. Possibly similar functionality for scaling, for the same reason?
3. Determine the base character size by image cell size

For messages, it uses Tilesets, not Framesets or graphic sheets.  The DrawText function of Display is only intended as a very basic fallback for outputting debug information.  Most other text should be output using the message functions added to GeneralRules, or by other functions to be added later or as custom code.

In our framework at work, DrawString actually takes in an X, Y, String, and an anchor, which is a logical OR on some flags: TOP, VERTICAL_CENTER, BASELINE, BOTTOM, LEFT, HORIZONTAL_CENTER, and RIGHT.  The anchors correspond to what the X and Y are actually pointing at (the BOTTOM HORIZONTAL_CENTER of the text for example).  It then offsets the x and y based on how big it calculates the string to be based on those flags.

I have something similar, but simpler:
Code: [Select]
public void SetMessagePosition(MessageView ViewOption, RelativePosition Position)
« Last Edit: 2008-09-27, 09:42:47 AM by bluemonkmn »

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #48 on: 2008-09-28, 10:21:58 AM »
The other major change in 2.1 besides OpenGL support is upgrading to .NET Framework 2.0, and as it turns out, NDoc, which was being used to generate the coding reference documentation, does not support .NET 2.0.  So I spent this weekend looking around for an alternative and found Sandcastle and the Sandcastle Help File Builder -- a UI that makes Sandcastle friendly to use (makes it look very similar to NDoc and even imports NDoc project files).  So I made a few adjustments to the documentation to make it work in with Sandcastle, and the result is very nice.  Everything is in one help file now, compiled by one process instead of being split into the UI help file compiled by HTML workshop and the coding reference compiled by NDoc.  The new documentation compiler is very flexible and allows all the other content to be included as the help file is compiled.  So I've got that all worked out, and it seems to be working well and looking very nice.  Next I'll update the sample project to work with the new message display functions that are based on tilesets instead of system fonts, and then maybe 2.1 will be ready to release.  Oh, and I must remember to try showing a graphic with the text of the message as Tanja suggested too.  I keep forgetting to test that, but that would be a good thing to demonstrate.

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: SGDK 2.1 - OpenGL Support
« Reply #49 on: 2008-09-28, 01:06:28 PM »
Yay! hope i can test the new sgdk soon.

SmartBoy16

  • Contributor
  • Fanatic
  • **
  • Posts: 587
  • Looking for inspiration.....
    • View Profile
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #50 on: 2008-09-28, 03:26:08 PM »
hopefully this one will work on older computers like mine  :pray:
Looking to the skies.....

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #51 on: 2008-09-28, 08:15:58 PM »
hopefully this one will work on older computers like mine  :pray:

It's not getting any older.  If the old one didn't work, the new one almost certainly isn't going to work.

SmartBoy16

  • Contributor
  • Fanatic
  • **
  • Posts: 587
  • Looking for inspiration.....
    • View Profile
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #52 on: 2008-09-29, 07:12:34 AM »
hopefully this one will work on older computers like mine  :pray:

It's not getting any older.  If the old one didn't work, the new one almost certainly isn't going to work.

i mean since it is using Open GL this time, which works just fine on mine
Looking to the skies.....

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #53 on: 2008-10-01, 03:45:24 AM »
what, and directx doesnt?

SmartBoy16

  • Contributor
  • Fanatic
  • **
  • Posts: 587
  • Looking for inspiration.....
    • View Profile
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #54 on: 2008-10-02, 06:56:28 AM »
it depends on what versions, DX5 used in SGDK1 works fine, but anything above 8 doesnt work as well or not at all
Looking to the skies.....

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #55 on: 2008-10-02, 08:39:19 AM »
wouldn't there be a way to force lower directx levels in your video driver options?

SmartBoy16

  • Contributor
  • Fanatic
  • **
  • Posts: 587
  • Looking for inspiration.....
    • View Profile
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #56 on: 2008-10-02, 03:23:09 PM »
not that i know of... ??? i'll just blame the video card, again! (this time its a Voodoo5)
Looking to the skies.....