Author Topic: Sint64  (Read 5505 times)

0 Members and 2 Guests are viewing this topic.

Peter

  • Guest
Sint64
« on: January 23, 2016, 11:53:59 AM »
Hi Charles,

I use for a  Sint64 type a QUAD type,  is this alright?

Charles Pegge

  • Guest
Re: Sint64
« Reply #1 on: January 24, 2016, 01:26:14 PM »
Hi Peter,

Sure. (the o2 quad type is a 64bit signed integer)

Peter

  • Guest
Re: Sint64
« Reply #2 on: January 24, 2016, 02:12:29 PM »
Thanks Charles,

I'm writing just a SDL2 library for OxygenBasic.
But I can the sdl_header not directly use, especially the keys definition from sdl.h.
Therefore I do everything by hand.

At the moment, I have trouble with SDL_Rect, somehow it does not work.  ???
I can not imagine that this definition is wrong:

typedef struct SDL_Rect
{
Uint16 x
Uint16 y
Uint16 w
Uint16 h
} SDL_Rect

jack

  • Guest
Re: Sint64
« Reply #3 on: January 24, 2016, 06:52:50 PM »
Peter, a C int is likely to be 32-bit and you are using 16-bit integers.

Peter

  • Guest
Re: Sint64
« Reply #4 on: January 24, 2016, 11:41:56 PM »
Hi Jack,

 :)

typedef struct SDL_Rect
{
  int x, y
  int w, h
} SDL_Rect

But still no success.

jack

  • Guest
Re: Sint64
« Reply #5 on: January 25, 2016, 07:58:52 AM »
sorry Peter, I am out of ideas
if Mike Lobanovsky shows up he may be able to help you.

Aurel

  • Guest
Re: Sint64
« Reply #6 on: January 25, 2016, 09:12:18 AM »


hi Peter look into link:

https://wiki.libsdl.org/SDL_Rect

so if i understand this thing this must be type not typedef

something like we use in windows
TYPE Rect .rc

Peter

  • Guest
Re: Sint64
« Reply #7 on: January 25, 2016, 09:26:00 AM »
Quote
sorry Peter, I am out of ideas

no, I need no help, I only was saying that I have trouble  with SDL_Rect.
nonetheless,  thanks for your help.

that poblem is somewhere else and I will find it.

Peter

  • Guest
Re: Sint64
« Reply #8 on: January 25, 2016, 09:38:34 AM »
Quote
so if i understand this thing this must be type not typedef

something like we use in windows
TYPE Rect .rc

Aurel you need  a warm oven to warm up your brain cells.   ;D

Charles Pegge

  • Guest
Re: Sint64
« Reply #9 on: January 25, 2016, 09:53:32 AM »

Hi Peter,

We don't have a core definition for uint16, but you can use word to define it before the C SDL headers

typedef word uint16

Peter

  • Guest
Re: Sint64
« Reply #10 on: January 25, 2016, 10:22:39 AM »
Thanks Charles,

I already did it.
Code: [Select]
TypeDef byte  uint8
TypeDef word  uint16
TypeDef dword uint32
TypeDef short Sint16
TypeDef int   Sint32
TypeDef quad  Sint64
[/code]

JRS

  • Guest
Re: Sint64
« Reply #11 on: January 25, 2016, 10:35:52 AM »
Quote from: Peter
Aurel you need  a warm oven to warm up your brain cells.

Good point Peter. I didn't consider the weather being a factor.  ;D


Aurel

  • Guest
Re: Sint64
« Reply #12 on: January 25, 2016, 02:41:25 PM »
FYB
SDL sucks anyway  :P
or better to say ..one reason more to not visit this forum...bye

JRS

  • Guest
Re: Sint64
« Reply #13 on: January 25, 2016, 03:50:39 PM »
FYB
SDL sucks anyway  :P
or better to say ..one reason more to not visit this forum...bye

I would wish you well but I would be lying. Sorry life didn't work out for you.

Charles Pegge

  • Guest
Re: Sint64
« Reply #14 on: January 27, 2016, 06:39:15 AM »
Hi Peter,

I looked at the definition in SDL_stdinc.h

Code: [Select]
typedef int16_t Sint16;
/**
 * \brief An unsigned 16-bit integer type.
 */
typedef uint16_t Uint16;
/**

so the solution might be to define before the SDL headers:

typedef word uint16_t
typedef short int16_t