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

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #30 on: 2008-09-05, 03:15:50 PM »
good to hear!

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: SGDK 2.1 - OpenGL Support
« Reply #31 on: 2008-09-06, 01:49:17 AM »
yep, cool.
if you are going to make tile-based text-drawing, does this mean there will be a bitmap with the alphabet?
maybe you could make a picture that is displayed above or beside the message, while you're at it....  ;D .... with an option for different emotions of the speaker ....

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 #32 on: 2008-09-06, 08:56:32 AM »
One thing at a time.  Yes, there will probably be some "Font" Tileset parameter for the message function, and the default project will have a default "Font" included.  Then maybe putting a picture on the left side of the message would be as simple as putting a strange letter (like that accent you were using, Tanja ;)) on the left (whose image is much bigger than a normal tileset tile) and making sure that your other letters don't overlap it.  Unfortunately providing a preview like in version 1.x won't be easy or nice because the SGDK2 plays dumb about what the functions do.  It just knows the name of the function and the parameters, so it doesn't know if you've selected a message function, or if you have, how the message is displayed, unless I hard-code a lot of assumptions, which is messy.  We'll see how it goes.

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 #33 on: 2008-09-06, 10:09:33 AM »
Note to self (that everyone is welcome to share).  Here's the code to generate the graphic sheet image for the font:
[code]
using (Font fnt = new Font("Lucida Console", 11))//, FontStyle.Bold))
{
   charPic = MakeFont(fnt, new Size((int)fnt.Size+2, fnt.Height+2), 24);
}

      private Bitmap MakeFont(Font font, Size charSize, int cols)
      {
         int rows = (int)(Math.Ceiling(96.0f / (float)cols));
         Bitmap result = new Bitmap(charSize.Width * cols, charSize.Height * rows, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
         using (Graphics gfx = Graphics.FromImage(result))
         {
            using (System.Drawing.Drawing2D.LinearGradientBrush br =
            new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, charSize.Width, charSize.Height), Color.White, Color.SlateBlue, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
            {
               byte[] charBytes = new byte[96];
               for (byte charIdx = 33; charIdx < 128; charIdx++)
               {
                  charBytes[charIdx - 33] = charIdx;
               }
               char[] chars = System.Text.Encoding.ASCII.GetChars(charBytes);
               chars[94] = '

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 #34 on: 2008-09-06, 09:32:47 PM »
I think a good use of the System.ComponentModel attributes could be applied in your case to get around hard-coding things.  If, for example, you used the System.ComponentModel.EditorAttribute, it could be used to preview various function calls in any way the coder wanted, and could also provide an interface for editing the arguments that's better than choosing from a generic dropdown list.
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 #35 on: 2008-09-07, 06:47:10 AM »
Interesting thought.  I might have to try that.  BTW, where did you get your new avatar?

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 #36 on: 2008-09-07, 09:08:24 AM »
I was looking through that Lost Garden website and saw some other graphic sets he had available for download, including a complete RTS section.  That's one of the building units being built, running, and being re-consumed all together.
Edward Dassmesser

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #37 on: 2008-09-07, 02:48:03 PM »
Neat. :)

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 #38 on: 2008-09-20, 08:59:13 AM »
I have committed a set of changes to SVN (for anyone who is interested in compiling the latest source code) with a complete and integrated solution for displaying messages.  I have not added the XML documentation text for it yet, nor tested it with arbitrary images included in the message, but it should work.  I'll keep working on it.  No longer are messages a separate customizable object.  There is one "ShowMessage" function that simply accepts a string for what to show.  And now all the other options are split into separate functions like "SetMessagePosition" and "SetMessageDismissal" for determining where the message appears and how it is dismissed.

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: SGDK 2.1 - OpenGL Support
« Reply #39 on: 2008-09-21, 03:52:55 AM »
oh joy! can i have the current version to test it out?

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 #40 on: 2008-09-21, 07:34:54 AM »
If you want the current version, you're going to have to compile it.  That involves finding an SVN client first, to download the files, then you'll need Visual C# 2008 Express Edition to actually compile it.  I tried with just the .bat file, but it seems to be out of date.

If you don't want to download an SVN client, you can download the latest version in a TAR file here:
http://sgdk2.svn.sourceforge.net/viewvc/sgdk2/branches/SGDK2IDE2.1.tar.gz?view=tar

But then you'll need a way to unTAR the files, which I think WinZip can do.

If you want to go the SVN route, I suggest TortoiseSVN

Then you want to actually check out the SVN files, which this url has instructions for.  Note, you'll want to append "/branches/SGDK2IDE2.1" to the path ("svn co https://sgdk2.svn.sourceforge.net/svnroot/sgdk2/branches/SGDKIDE2.1 sgdk2") to get the latest version

Once you have the files on your computer, you can try using the makesgdk2.bat file to compile, but it probably won't work.  At the very least, you have to edit the file and replace "path %windir%;%windir%\System32;%windir%\Microsoft.NET\Framework\v1.1.4322" with "path %windir%;%windir%\System32;%windir%\Microsoft.NET\Framework\v2.0.50727"

Then just double-click on the batch file.  It will probably fail, however.  There are other ways to compile the project, but the easiest, in my mind, is to just download Visual C# 2008 Express Edition, which you can get from here:

http://www.microsoft.com/express/download/ (You will want the green one)

Once you have that installed, just double-click on sgdk2.sln, which will open the file in C#.  At this point, you can build the project by (I believe) pressing CTRL+SHIFT+B.  This will create a directory called "bin" under the root sgdk2 directory.  Go there.  Under that you'll find another directory, either Debug or Release.  Go into that, and you should find sgdk2ide.exe, which you can run.
Edward Dassmesser

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: SGDK 2.1 - OpenGL Support
« Reply #41 on: 2008-09-21, 11:59:04 AM »
wow.  ??? okay. i'll try this.

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #42 on: 2008-09-21, 03:00:25 PM »
heh...good luck! ;)

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 #43 on: 2008-09-22, 05:16:15 AM »
I tried with just the .bat file, but it seems to be out of date.

D'oh!  I forgot about the BAT file.  Gotta fix that.

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SGDK 2.1 - OpenGL Support
« Reply #44 on: 2008-09-22, 01:43:54 PM »
Good luck to that too :)