Re: SFML2 Demo Dilema - Solved

new topic     » goto parent     » topic index » view thread      » older message » newer message

One more.

typedef struct 
{ 
  unsigned int width; 
  unsigned int height; 
  unsigned int bitsPerPixel; 
} sfVideoMode; 

Traditional method..

-- struct sfVideoMode 
public constant 
    sfVideoMode__width        =  0, -- unsigned int 
    sfVideoMode__height       =  4, -- unsigned int 
    sfVideoMode__bitsPerPixel =  8, -- unsigned int 
    SIZEOF_SFVIDEOMODE        = 12, 
$ 
 
-- example 
atom mode = allocate_data( SIZEOF_SFVIDEOMODE, 1 ) 
atom width  = peek4u( mode + sfVideoMode__width ) 
atom height = peek4u( mode + sfVideoMode__heigth ) 
-- etc. 

and 4.1 with memstruct...

public memstruct sfVideoMode 
    unsigned int width 
    unsigned int height 
    unsigned int bitsPerPixel 
end memstruct 
 
-- example: 
atom mode = allocate_data( sizeof(sfVideoMode) ) 
atom width  = mode.sfVideoMode.width 
atom height = mode.sfVideoMode.height 
-- etc. 

I think you get the point. smile

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu