PureBasic Docs - Errors & needed improvements to the man

Found an issue in the documentation ? Please report it here !

Moderator: Documentation Editors

User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

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

Post 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. :|
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

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

Post 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
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

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

Post 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?
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

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

Post by Guimauve »

@Kuron : SORRY DARLING !

Please just ignore my intervention.

Bye Bye
Guimauve
User avatar
Shardik
Addict
Addict
Posts: 1984
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

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

Post 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
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

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

Post by IdeasVacuum »

The Useful Internet Links page has a lot of broken links/discontinued websites.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2050
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

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

Post 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:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2050
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

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

Post 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:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

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

Post 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...
User avatar
Rings
Moderator
Moderator
Posts: 1427
Joined: Sat Apr 26, 2003 1:11 am

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

Post 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]
SPAMINATOR NR.1
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

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

Post 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.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Danilo
Addict
Addict
Posts: 3037
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

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

Post 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)
User avatar
Demivec
Addict
Addict
Posts: 4082
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

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

Post 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]
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2050
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

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

Post 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 :-)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

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

Post 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
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Locked