Oxygen Basic

Programming => Problems & Solutions => Topic started by: Peter on May 02, 2012, 02:00:26 PM

Title: Out of range
Post by: Peter on May 02, 2012, 02:00:26 PM
Deleted
Title: Re: Out of range
Post by: Charles Pegge on May 02, 2012, 04:14:40 PM
Hi Peter,

You don't give away many clues :) but I eventually found a problem, which was related to a byte accumulator overflow. I have fixed this bug by enforcing a full width accumulator. I can only assume this was what triggered the error in your software.

It has been lurking in the woodwork for a long time, well before the 2012 Oxygens.

I need to test this fix with all the programs. Will post ASAP.

Charles
Title: Re: Out of range
Post by: Charles Pegge on May 03, 2012, 04:23:58 AM
Answer: 2570

Next bug please :)


ps: oxygen.zip now removed
Title: Re: Out of range
Post by: Charles Pegge on May 03, 2012, 07:15:46 AM
Hi Peter, just fix this line at the top of the prog.

int a[2] => (1, 2)
Title: Re: Out of range
Post by: Charles Pegge on May 03, 2012, 07:57:53 AM
Your UFO demo works fine Peter, but crashes when terminated. What is your termination procedure for Opengl?
Title: Re: Out of range
Post by: Charles Pegge on May 03, 2012, 12:24:40 PM
That one terminated without crashing, though I think Gl resources should be deleted before releasing the device context

Here is my termination sequence in winmain, after the message loop : (projects/OpenGLGUI/Openglview.inc)

Code: [Select]

while GetMessage @wm,0,0,0
    TranslateMessage @wm
    DispatchMessage @wm
  wend
  '
  glDeleteTextures( 32, texn )
  glDeleteLists drawing_list,ListCount
  glDeleteLists 1000, 255 ' font
  '
  wglMakeCurrent hDC, NULL
  wglDeleteContext hRC
  ReleaseDC hWnd,hDC

  #ifdef GDIplus
  GdiplusShutdown token
  #endif

  function=wm.wparam

  end function ' end of WinMain

Program objects and other resources are released after this.

Charles

PS: if you are using OpenGl declarations (not low level binding) then
FreeLibrary OpenGl
should not be used. Oxygen does this later, it its epilog code as with other DLLs.