The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL2 direct3d renderer and Windows XP
Gabriele Greco
Guest

Does the "direct3d" renderer still supports windows XP?

I've not seen notice anywhere that SDL dropped XP....


I've a minimal program that updates a texture in a loop that using both mingw-w64 2.0.3 binaries from libsdl.org and with self compiled HG head binaries does work with software renderer but does not with the default accelerated one (direct3d), while it works perfectly on a wide range of windows 7 machines (and linux removing outputdebugstring stuff). The program is supposed to show a white line moving on a black background, in windows XP it just displays a black window.


The code is here (excuse the indent but I tried to keep it small), maybe it's a problem with mingw64 build, can someone try to build it with visual studio and check if it works?


#include "SDL.h"
#include "debugapi.h"



int SW=352, SH=288;


int main(int argc, char *argv[])
{
    OutputDebugString("Start!");
    if (SDL_Init(SDL_INIT_VIDEO)) { OutputDebugString(SDL_GetError()); return 0; }
    SDL_Window *w = SDL_CreateWindow("Test", 100, 100, SW, SH, SDL_WINDOW_RESIZABLE);
    if (!w) { OutputDebugString(SDL_GetError()); return 0;  }
    SDL_Renderer *r = SDL_CreateRenderer(w, -1,  SDL_RENDERER_ACCELERATED|SDL_RENDERER_PRESENTVSYNC /* WORKS replacing the previous flags with SDL_RENDERER_SOFTWARE */);
    if (!r) { OutputDebugString(SDL_GetError()); return 0; }


    SDL_RendererInfo info;
    SDL_GetRendererInfo(r, &info);
    OutputDebugString(info.name);
    SDL_Texture *t = SDL_CreateTexture(r, SDL_PIXELFORMAT_YV12, SDL_TEXTUREACCESS_STATIC,  SW, SH);
    if (!t) { OutputDebugString(SDL_GetError()); return 0; }
    Uint8 *v = (Uint8*)SDL_malloc(SW * SH * 3 / 2);
    memset(v, 0, SW * SH * 3 / 2);  memset(v + SW * SH, 127, SW * SH / 2);
    Uint8 *y = v;
    OutputDebugString("Starting loop!");


    while(1) {
        SDL_Event e;
        while (SDL_PollEvent(&e)) {
            if ( (e.type == SDL_KEYUP && e.key.keysym.sym == SDLK_ESCAPE) ||
                 (e.type == SDL_WINDOWEVENT && e.window.event == SDL_WINDOWEVENT_CLOSE))   {
                OutputDebugString("Quit!");
                SDL_Quit();
                return 0;
            }
        }


        y += SW;
        memset(v, 0, SW * SH); memset(y, 255, SW * 50);


        if ((y + 50 * SW) >= (v + SW * SH)) y = v;


        SDL_UpdateYUVTexture(t, NULL, v, SW, v + (SW*SH), SW/2, v + (SW*SH*5/4), SW/2);
        SDL_RenderCopy(r, t, NULL, NULL);
        SDL_RenderPresent(r);
    }
}





--
Bye,
 Gabry
SDL2 direct3d renderer and Windows XP
Sik


Joined: 26 Nov 2011
Posts: 905
2015-09-24 5:42 GMT-03:00, Gabriele Greco:
Quote:
Does the "direct3d" renderer still supports windows XP?

Isn't that the Direct3D 9 one? It should in that case if it isn't
calling something new in the Windows API.

Quote:
I've not seen notice anywhere that SDL dropped XP....

Yeah, although I wonder if anybody has checked that this is 100% the
case among SDL. I know that with the binaries I had used with Sol, it
would work even on Windows 98 with KernelEx as long as you stubbed two
more functions (AllocConsole and FreeConsole). Not sure if this is
still true in the custom 2.0.4 the final version shipped (yes, Sol is
using something between 2.0.3 and 2.0.4 Razz I needed that iBus support
on Linux!)

There's also the question about whether it's still worth supporting,
but then again the OpenGL 1.x fixed pipeline is still supported as
well as far as I know...
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
AntTheAlchemist


Joined: 13 Feb 2015
Posts: 60
Location: UK
I've been developing completely under XP, and had no problems with SDL 2.0.3. Works like a dream.

When people stop supporting XP, it causes me problems, so please don't neglect this awesome operating system.
SDL2 direct3d renderer and Windows XP
Gabriele Greco
Guest

On Wed, Sep 30, 2015 at 12:22 AM, AntTheAlchemist wrote:
Quote:
I've been developing completely under XP, and had no problems with SDL 2.0.3. Works like a dream.

When people stop supporting XP, it causes me problems, so please don't neglect this awesome operating system.






Can you try if the provided code (in the original topic) on your system shows a white line moving on a black window or not?


Maybe it's only an issue in the shader with old video hardware and not an OS problem.


--
Bye,
 Gabry