Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
96 user(s) are online (92 user(s) are browsing Forums)

Members: 1
Guests: 95

salass00, more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: SDL1 open issues

Subject: Re: SDL1 open issues
by kas1e on 2018/1/14 16:44:09

I made another test case, in which i just set CursorData to 0xaa (1010 1010 , so 4 dots), and mask to 0. So, it should just draw 4 dots over cursor. On win32 it is, but on aos4 it's draw garbage. There is:

#include <SDL/SDL.h> 

int mousexmousey

SDL_Surfaceinit_sdl(int widthint height

    
SDL_Init(SDL_INIT_VIDEO); 
    return 
SDL_SetVideoMode(widthheight0SDL_HWSURFACE SDL_DOUBLEBUF); 


void exit_sdl(SDL_Surfacesurface

    
SDL_FreeSurface(surface); 
    
SDL_Quit(); 


// Chopped down even function 
int events() 

    
SDL_Event event
    while(
SDL_PollEvent(&event)) 
    { 
        switch(
event.type
        { 
            case 
SDL_MOUSEMOTION
                
mousex event.motion.x

                
mousey event.motion.y
            break; 


            case 
SDL_QUIT: return 0
        } 
    } 
    return 
1





int main() 


    static 
SDL_Cursorcur NULL
     
    static 
uint8_t cursorData 0xaa// 4 dots. 
    
static uint8_t cursorMask 0// for transparent cursor 

    
SDL_Surface *surf init_sdl(640480); 
    
SDL_FreeCursor(cur);  
    
cur SDL_CreateCursor(&cursorData, &cursorMask1,1,0,0); 

    while(
events()) 
    { 
        if (
cur != NULL)  
        {  
            
SDL_SetCursor(cur);  
            
SDL_ShowCursor(SDL_ENABLE); // show the SDL 1 pixel transparent cursor  
        
}  
        else  
        {  
            
//failed to create the 1 pixel transparent cursor  
            
SDL_ShowCursor(SDL_DISABLE); // Hide the SDL mouse cursor, we use our own internal one  
        
}  
    } 

    
exit_sdl(surf); 
}


Same as before : ppc-amigaos-gcc test.c -o test -lSDL -lpthread

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project