Page 14 of 15

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Sun Jan 15, 2012 5:10 am
by Kuron
It is not false. Textures should be in a power of two. The manual merely lists some of the more common sizes that are a power of two. Naturally, it will not list all possible sizes as this would be infinite. What sizes you can actually use are a limit of your GFX card and will also depend on the rendering API (and version) being used.

As to rectangle vs square, I have been out of school for a long time, so I may not be remembering correctly, but I thought a rectangle was a quadrilateral with four right angles and a square was a rectangle with four equal sides? If this is correct, then the manual would be listing rectangular dimensions. However, it is obviously not listing oblong rectangular dimensions, just square rectangular dimensions. :|

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Sun Jan 15, 2012 6:57 am
by Guimauve
Kuron wrote:It is not false. Textures should be in a power of two. The manual merely lists some of the more common sizes that are a power of two. Naturally, it will not list all possible sizes as this would be infinite. What sizes you can actually use are a limit of your GFX card and will also depend on the rendering API (and version) being used.

As to rectangle vs square, I have been out of school for a long time, so I may not be remembering correctly, but I thought a rectangle was a quadrilateral with four right angles and a square was a rectangle with four equal sides? If this is correct, then the manual would be listing rectangular dimensions. However, it is obviously not listing oblong rectangular dimensions, just square rectangular dimensions. :|
As the Help file says :

Texture need to be Square ---> Square mean 64X64, 128X128, 256X256 or in the other end the texture Width = Texture Height and this is not true.

X-Wing Alliance game created by Totally Games/LucasArts use rectangular texture in their opt file (the opt file contain the geometry and textures packed together).

Best regards
Guimauve

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Sun Jan 15, 2012 12:25 pm
by Kuron
I replied to your exact words previously. If you have an issue with what I was replying to, you need to take it up with the person who made the post that I was replying to, which would appear to be you. You can contact yourself here.

Guimauve wrote: As the Help file says :

Texture need to be Square ---> Square mean 64X64, 128X128, 256X256 or in the other end the texture Width = Texture Height and this is not true.
These words above are also false. The manual does NOT say this. The manual clearly says: It's strongly recommended to make the texture square and with power of 2 width/height: 64x64, 128x128, 256x256... Old GFX cards can have limitation, so if possible limit the texture size to 256x256.

The manual says it is strongly recommended to make the texture square, it does NOT say the texture needs to be square.

The manual also says and with power of 2 width/height. The manual does NOT say the width and height have to be equal powers of 2.

As I stated before: The manual merely lists some of the more common sizes that are a power of two. Naturally, it will not list all possible sizes as this would be infinite. What sizes you can actually use are a limit of your GFX card and will also depend on the rendering API (and version) being used.

Guimauve wrote:X-Wing Alliance game created by Totally Games/LucasArts use rectangular texture in their opt file (the opt file contain the geometry and textures packed together).
I am very happy for them. Achievements like this deserve to be recognized and praised. Perhaps you should send them a congratulatory cake, or at least a card and some flowers?

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Sun Jan 15, 2012 3:52 pm
by Guimauve
@Kuron : SORRY DARLING !

Please just ignore my intervention.

Bye Bye
Guimauve

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Wed Jan 18, 2012 12:15 pm
by Shardik
The code example for CreatePopupMenu() in PB's help file contains the Windows API
constant #WM_RButtonDown and therefore doesn't work in PB's Linux and MacOS
versions. I therefore modified that code example for Linux:

Code: Select all

ProcedureC RightClickHandler(*Event.GdkEventButton, *UserData, *DestroyNotify)
  If *Event\type = #GDK_BUTTON_PRESS
    If *Event\button = 3                ; Right mouse button?
      DisplayPopupMenu(0, WindowID(0))  ; Display the popup-menu if yes
    EndIf
  EndIf
  gtk_main_do_event_(*Event)
EndProcedure

If OpenWindow(0, 200, 200, 200, 120, "Popup-Menu Example")
  gdk_event_handler_set_(@RightClickHandler(), 0, 0)
  If CreatePopupMenu(0)      ; creation of the pop-up menu begins...
    MenuItem(1, "Open")      ; You can use all commands for creating a menu
    MenuItem(2, "Save")      ; just like in a normal menu...
    MenuItem(3, "Save as")
    MenuItem(4, "Quit")
    MenuBar()
    OpenSubMenu("Recent files")
    MenuItem(5, "PureBasic.exe")
    MenuItem(6, "Test.txt")
    CloseSubMenu()
  EndIf
  Repeat
    Select WaitWindowEvent()     ; check for window events
      Case #PB_Event_Menu        ; an item of the popup-menu was clicked
        Select EventMenu()       ; get the clicked menu item...
          Case 1 : Debug "Menu: Open"
          Case 2 : Debug "Menu: Save"
          Case 3 : Debug "Menu: Save as"
          Case 4 : Quit = 1
          Case 5 : Debug "Menu: PureBasic.exe"
          Case 6 : Debug "Menu: Text.txt"
        EndSelect
      Case #PB_Event_CloseWindow
        Quit = 1
    EndSelect
  Until Quit = 1
EndIf
And this is the modified code example for MacOS:

Code: Select all

#kEventClassWindow = $77696E64 ; 'wind'
#kEventWindowContextualMenuSelect = 78

Structure EventTypeSpec
  EventClass.L
  EventKind.L
EndStructure

ProcedureC RightClickHandler(*NextEventHandler, Event.L, UserData.L)
  DisplayPopupMenu(0, WindowID(0))  ; now display the popup-menu
EndProcedure

Dim EventTypes.EventTypeSpec(0)

If OpenWindow(0, 200, 200, 200, 120, "Popup-Menu Example")
  EventTypes(0)\EventClass = #kEventClassWindow
  EventTypes(0)\EventKind = #kEventWindowContextualMenuSelect
  InstallEventHandler_(GetWindowEventTarget_(WindowID(0)), NewEventHandlerUPP_(@RightClickHandler()), 1, @EventTypes(), 0, 0)
  If CreatePopupMenu(0)      ; creation of the pop-up menu begins...
    MenuItem(1, "Open")      ; You can use all commands for creating a menu
    MenuItem(2, "Save")      ; just like in a normal menu...
    MenuItem(3, "Save as")
    MenuItem(4, "Quit")
    MenuBar()
    OpenSubMenu("Recent files")
    MenuItem(5, "PureBasic.exe")
    MenuItem(6, "Test.txt")
    CloseSubMenu()
  EndIf
  Repeat
    Select WaitWindowEvent()     ; check for window events
      Case #PB_Event_Menu        ; an item of the popup-menu was clicked
        Select EventMenu()       ; get the clicked menu item...
          Case 1 : Debug "Menu: Open"
          Case 2 : Debug "Menu: Save"
          Case 3 : Debug "Menu: Save as"
          Case 4 : Quit = 1
          Case 5 : Debug "Menu: PureBasic.exe"
          Case 6 : Debug "Menu: Text.txt"
        EndSelect
      Case #PB_Event_CloseWindow
        Quit = 1
    EndSelect
  Until Quit = 1
EndIf

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Fri Jan 20, 2012 2:17 am
by IdeasVacuum
The Useful Internet Links page has a lot of broken links/discontinued websites.

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Sat Feb 04, 2012 9:47 pm
by Andre
Thanks shardik for your code exemples!

But about the CreatePopupMenu() examples: I don't think (even more Fred & freak), that the PB help should be filled with API-related stuff/code examples. So it's already not so good, that the current help example uses a Windows-specific constant.

I think, it's time for a native implementation on all 3 supported OS, which is up to Fred & freak! :twisted:

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Sun Feb 12, 2012 10:29 pm
by Andre
Shardik wrote: unfortunately you seem to have forgotten to add a remark to each
Gadget description in the help for which the SetGadgetColor() and
SetGadgetItemColor() commands on the Mac don't work (in contrast
to the Windows and Linux version). Do you remember my fancy table
which lists all non-working color commands on the Mac? freak
decided that a remark should have been added to each Gadget
description which doesn't work with color commands on the Mac:
freak wrote:Don't add that table. Add a note in the topic for each function instead.
All needed notes are added to the manual, for PB4.61... :)

By the way, I've added the completely missing remarks about coloring possibilities at the TreeGadget() now... :wink:

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Thu Mar 01, 2012 8:03 pm
by Foz
Could "Command lines" and/or "Parameters" be added to the index please and let it point to ProgramParameter...

I've just wasted a good half hour looking for how to get the command line parameters... and as it's something that I rarely use, I can forsee myself doing the same again in a year or two...

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Tue Mar 27, 2012 8:10 am
by Rings
complete the physic commands in the docs,
see here:
http://www.purebasic.fr/english/viewtop ... 0&start=25


[Andre on 5th Oct. 2012: done with PB5.00b4]

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Tue Mar 27, 2012 10:38 am
by luis
Foz wrote:Could "Command lines" and/or "Parameters" be added to the index please and let it point to ProgramParameter... I've just wasted a good half hour looking for how to get the command line parameters...
Index only match the correct name. If you don' know the correct name and you are looking for it use the search field. Entering "commandline" in the search field returns ProgramParameter.

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Mon Apr 30, 2012 5:39 pm
by Danilo
PB help for Chr():
Syntax

Text$ = Chr(ASCII-Value)

Description

Returns the character associated with the given ASCII value.
Works also in Unicode mode (and it should!), so it would be nice to make that clear in the documentation:

"Returns a string with the character associated with the given ASCII/UNICODE value."

Code: Select all

Debug Chr(401)
Debug Chr(956)

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Thu May 10, 2012 1:17 am
by Demivec
On the page for "Array" in the manual the example Array.pb and the help page is missing.

Originally reported in this link by akee.


[Andre on 5th Oct. 2012: works in PB5.00b4]

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Mon May 14, 2012 10:52 pm
by Andre
Danilo wrote:PB help for Chr():
Works also in Unicode mode (and it should!), so it would be nice to make that clear in the documentation:
I've added a remark + example about unicode support :-)

Re: PureBasic Docs - Errors & needed improvements to the man

Posted: Sun Aug 05, 2012 2:26 pm
by IdeasVacuum
Images: The Help does not distinguish between a PB ImageID and an OS Image Handle, which is in fact critical. Please see this thread:
http://www.purebasic.fr/english/viewtop ... 16#p386616