SDL 2 Release Candidate

SDL 2 Release Candidate

Postby Sauer2 » 08 Jun 2013, 17:12

According to its news site, SDL 2 is now released:
http://www.libsdl.org/news.php

That includes the main library as well as SDL_image and SDL_mixer.
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: SDL 2 Release Candidate

Postby Evropi » 08 Jun 2013, 18:10

The title is accurate, but the content is a bit of a misnomer... this is a release candidate. This means that this is not considered very stable, but certainly, it is close to a release and no new features will be added. Lots of games (and other applications) are using it already though, so it won't be long till it hits stable.
You just wasted 3 seconds of your life reading this.
User avatar
Evropi
 
Posts: 385
Joined: 02 Sep 2012, 16:18

Re: SDL 2 Release Candidate

Postby Sauer2 » 09 Jun 2013, 18:30

Actually, I'm surprised that there wasn't a blog entry from Sam Latinga and also no forum announcement in the SDL forum.
I mean, normally, we get SDL news via our planet, right? Did i miss that?
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: SDL 2 Release Candidate

Postby dusted » 10 Jun 2013, 07:44

Great! Looking forward to when the -net and -ttf libs are also ported, then I have everything I want :D

As for the release-candidate discussion;

A release-candidate is potentially a final version, the only difference change between the last release-candidate and the final version shall always be no more than a simple change of version name.
Potentially, new bugs are found, corrected and a new release candidate is made.
User avatar
dusted
 
Posts: 83
Joined: 27 Feb 2010, 04:35

Re: SDL 2 Release Candidate

Postby amuzen » 10 Jun 2013, 08:38

Based on their repositories and the migration guide, it looks like most of the extensions are usable with SDL 2 already if you compile them from the repository. However, I don't know how long it will take for them to get an official SDL 2 compatible release out. By the way, the migration guide is good reading if you want to get a quick idea of what has changed since 1.2.

To me, the big questions are, how long will it take for distros to package SDL 2, as well as how many games will migrate and how fast. However, I'm hopeful that the migration will be relatively painless since they actually changed the name of the library after breaking backwards compatibility. At any rate, the migration can't take longer than it took for them to get SDL 2 itself out. :p
User avatar
amuzen
LoS Moderator
 
Posts: 327
Joined: 05 Dec 2009, 02:49

Re: SDL 2 Release Candidate

Postby dusted » 10 Jun 2013, 09:07

I've just spent some time compiling what I needed and started porting Wizznic for fun, and I stopped, I'm certain I'll look towards SDL2 in my next project (statically compiled, I wouldn't need worrying about distributions being behind), but as my current project is SDL_Surface centric and I'm hand-writing almost the same amount of pixels to screen as SDL, I've concluded that I will gain nothing by completing the port.

I think the new way of dealing with textures and surfaces makes a bit sense, but it seems to me that it is nothing more than a thin abstraction on top of OpenGL.
User avatar
dusted
 
Posts: 83
Joined: 27 Feb 2010, 04:35

Re: SDL 2 Release Candidate

Postby charlie » 10 Jun 2013, 14:52

Evropi {l Wrote}:The title is accurate, but the content is a bit of a misnomer... this is a release candidate. This means that this is not considered very stable, but certainly, it is close to a release and no new features will be added. Lots of games (and other applications) are using it already though, so it won't be long till it hits stable.

There was a series of replies since deleted (which I did not entirely approve of TBH... one man's disagreement is another's "trolling").

This is a mis-statement (as conceded by Evropi). A release candidate is considered to be pretty stable but needs wider testing.
Free Gamer - it's the dogz
Vexi - web UI platform
User avatar
charlie
Global Moderator
 
Posts: 2131
Joined: 02 Dec 2009, 11:56
Location: Manchester, UK

Re: SDL 2 Release Candidate

Postby Sauer2 » 16 Jun 2013, 21:45

And SDL2_ttf has a release candidate, too:
http://forums.libsdl.org/viewtopic.php? ... e5a49fdd15
Althought this is not noted on the main page, I guess this is pretty valid.

At the same time, I have a problem loading fonts - TTF_OpenFont(...) always returns nullptr.
I guess I made everything possible, like putting the fonts (BioLinum regular and Vera monospace) in the executable folder as well as the DLLs.
I set up my environment as described here: http://twinklebeardev.blogspot.de/2012/ ... tudio.html (plus adding the ttf paths) and called TTF_Init() as described.

Could this be a bug or does this work for you?
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: SDL 2 Release Candidate

Postby Buch » 16 Jun 2013, 22:27

I managed to compile and get SDL2_ttf running under mingw on a 32-bit Windows XP - no relevant issues to me. You should give some more information on what you did, so you can get proper help
User avatar
Buch
 
Posts: 51
Joined: 15 Jan 2013, 14:30
Location: Castel del Piano, Grosseto, Italy

Re: SDL 2 Release Candidate

Postby Sauer2 » 16 Jun 2013, 22:46

Right. I used VS Express 2012 to compile the following code:
{l Code}: {l Select All Code}
#include "SDL.h"
#include "SDL_ttf.h"

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char** argv) {
   
   // SDL vars...
   SDL_Window *window = nullptr;
   SDL_Renderer *renderer = nullptr;

   // Setting up SDL...
   if (SDL_Init(SDL_INIT_EVERYTHING) == -1) {
      cout << SDL_GetError() << endl;
      return 1;
   }

   // ...create the window...
   window = SDL_CreateWindow("Input-Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_SHOWN);

   if (window == nullptr) {
      cout << SDL_GetError() << endl;
      return 1;
   }

   // ...and the renderer.
   renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);

   if (renderer == nullptr) {
      cout << SDL_GetError() << endl;
      return 1;
   }

   // Set up TTF.
   if (TTF_Init() != 0) {
      string msg = TTF_GetError();
      cout << msg << endl;
   }

   // Background
   SDL_Rect backgroundRect;
   backgroundRect.x = 0;
   backgroundRect.y = 0;
   backgroundRect.w = 640;
   backgroundRect.h = 480;

   // Load the font.
   TTF_Font *font = TTF_OpenFont("VeraMono.ttf", 18);
   if (font == nullptr) {
      string msg = TTF_GetError();
      cout << msg << endl;
      return 1;
   }
   SDL_Color fontColor = {255,255,255,255};
   SDL_Surface *fontSurface = TTF_RenderText_Blended(font, "Press c to open console, Esc to abort and Enter to confirm.", fontColor);
   SDL_Texture *fontTexture = SDL_CreateTextureFromSurface(renderer, fontSurface);

   // The main loop.
   bool quit = false;

   SDL_Event event;
   while (!quit) {

      // Events and updates...
      while (SDL_PollEvent(&event)) {

         if (event.type == SDL_QUIT)
            quit = true;

         if (event.type == SDL_KEYDOWN) {
            if (event.key.keysym.sym == SDLK_q)   {
               quit = true;
            }
         }

      }

      // Draw stuff.      
      SDL_RenderClear(renderer);

      SDL_SetRenderDrawColor(renderer, 51, 130, 152, 0);
      SDL_RenderFillRect(renderer, &backgroundRect);
      
      SDL_RenderCopy(renderer, fontTexture, nullptr, nullptr);

      
      SDL_RenderPresent(renderer);
      SDL_Delay(10);
   }

   TTF_CloseFont(font);
   SDL_DestroyTexture(fontTexture);
   SDL_FreeSurface(fontSurface);
   SDL_DestroyRenderer(renderer);
   SDL_DestroyWindow(window);
   TTF_Quit();
   SDL_Quit();
   return 0;
}


The SDL part worked, since the blue background was shown before i included the font code, but for some reasons i can't load the font.
I also checked file permission.
The directory looks like this, so I guess, no file is missing.
dir.png
the folder content
dir.png (16.02 KiB) Viewed 9130 times

Thanks for your help!

Edit: Forgot to mention, i compile this on Windows 7 64 as 32 bit file.
Edit 2: I found the problems.
* For suspicious reasons the executable has to be started without the visual studio debugger, because VS fails at loading ressources like fonts or images in SDL.
* For another strange reason (unlike in my image test project) the executable expects the font file to be placed in project folder, not in the executable folder. :o Sometimes, it works, sometimes not... Very strange.

It's stuff like this which makes me wish for the simple gcc toolchain.
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: SDL 2 Release Candidate

Postby Julius » 17 Jun 2013, 08:13

Sauer2 {l Wrote}:It's stuff like this which makes me wish for the simple gcc toolchain.


Yep, no wonder people cross-compile stuff with mingw ;)
User avatar
Julius
Community Moderator
 
Posts: 3297
Joined: 06 Dec 2009, 14:02

Re: SDL 2 Release Candidate

Postby Sauer2 » 18 Jun 2013, 18:49

For the Python guys: There is a binding, which claims to run with Python 2, 3 and PyPy 1.8+.
http://pysdl2.readthedocs.org/en/latest/index.html
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Who is online

Users browsing this forum: No registered users and 1 guest