RE: poke4 won't accept my 32bit values

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

I tried changing the TranslateMessage Param to C_UINT,C_LONG,C_ULONG, 
etc.. but no go..

Also, I've never attempted to convert the examples to C.. not really any 
point seeing as the original demos were FROM C.

Chris

just a bit of psuedo-code to maybe help you to uderstand my problem 
better...
not functional code.
procedure names aren't even accurate..

This is how the original demos work..
<ORIGINAL PSUEDO CODE>

function Init_Loop()
   EXOTICA_INIT()
   etc...
   etc...
end function

procedure Animate_Scene()
  Set_Color(#FFFFFFFF)
end procedure

function Main_Loop()
   CLEAR_SURFACE(0)
   Animate_Scene()   -- This contains the calls to set the color of the 
objects etc..
   etc...
   etc...
   if KeyPress() = ESCAPE then return 1 end if
 return 0
end function

function Exit_Loop()
   EXOTICA_EXIT()
 return 0
end function



<END OF ORIGINAL PSUEDO CODE>
On calling WinMain,
 the Init_Loop() will be executed immediately only once,
 the Main_Loop() will be executed in the message loop, exiting the loop 
if it returns True.. 
 the Exit_Loop is called at the very end(Not really nessecary to be 
called from WinMain as it is called at the very end of WinMain with no 
code specific to WinMain..)


<EXOTICAX PSUEDO CODE>
exotica_init()  -- WinMain is initialized here..

procedure Animate_Scene()
   Set_Color(#FFFFFFFF)
end procedure

while not KeyPress() = ESCAPE do
   clear_surface(0)
   Animate_Scene()
   etc...
   etc...
   etc...
--- exotica_error() contains the message loop to poll for windows 
messages
   if exotica_error() then exotica_abort(1) end if
end while

exotica_exit()

<END OF EXOTICAX PSUEDO CODE>
This works fine as long as I don't need to poke the color values 
directly to memory..
But when I do try to poke the values, it says the value is not 32bit.

I hope this helps you to understand my dilemna..

Chris


Derek Parnell wrote:
> >
> > C_INT, what should it be?
> >
> > But even if this is the problem.. it is exclusive to my code.. No
> > problems in the original Exotica demos..
> >
> 
> I'm not sure, maybe Robert can chip in here, but C_UINT is a 32-bit 
> unsigned
> integer and C_INT is a 32-bit signed integer. Maybe when Euphoria 
> invokes
> the c_func() routine it converts the supplied parameters based on these
> signatures. If it uses C_INT, it might be chopping off the high bits.
> 
> This is just a guess.
> 
> I'm also guessing that its Euphoria interpreter you are having trouble 
> with.
> Is it? Or is this the translated C code?
> 
> ------
> Derek Parnell
> Melbourne, Australia
> "To finish a job quickly, go slower."
> 
> 
> 
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu