January 15, 2021, 06:18:58 PM

Author Topic: [bb] Setting the Gfx Driver and Screen Resolution by Captain Wicker (crazy hillbilly) [ 1+ years ago ]  (Read 400 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
Title : Setting the Gfx Driver and Screen Resolution
Author : Captain Wicker (crazy hillbilly)
Posted : 1+ years ago

Description : Shows how to set the graphics driver and how to allow the user to set the screen resolution using strings and floats.

Code :
Code: BlitzBasic
  1. Graphics 800, 600, 16, 2
  2.  
  3. chipset = CountGfxDrivers()
  4. Print "Select a graphics driver:"
  5.  
  6. For g = 1 To chipset
  7.  
  8.         Print g + " = " + GfxDriverName$(g)
  9.        
  10. Next
  11.  
  12. Selected = Input("")
  13.  
  14.  
  15. SetGfxDriver Selected
  16.  
  17. Text 0,0,"Drivers Settings Applied"
  18.  
  19. width# = GraphicsWidth()
  20. height# = GraphicsHeight()
  21.  
  22. Print "Type Screen Width: "
  23.  
  24. INwidth$ = Input("")
  25.  
  26. width# = INwidth$
  27.  
  28. Print "Type Screen Height: "
  29.  
  30. INheight$ = Input("")
  31.  
  32. height# = INheight$
  33.  
  34.  
  35. Graphics3D width#, height#, 32, 3
  36. SetBuffer(BackBuffer() )
  37.  
  38. Global light,camera,cube
  39.  
  40. light=CreateLight()
  41. RotateEntity light,90,0,0
  42.  
  43. camera=CreateCamera()
  44.  
  45. cube=CreateCube()
  46. PositionEntity cube,0,0,5
  47.  
  48. gwidth# = GraphicsWidth()
  49. gheight# = GraphicsHeight()
  50.  
  51. mywidth$ = "Screen Width: " + Str gwidth#
  52. myheight$ = "Screen Height: " + Str gheight#
  53.  
  54. While KeyHit(1)<>True
  55.        
  56.         TurnEntity cube,1,2,3
  57.        
  58.  
  59.  
  60.         UpdateWorld
  61.         RenderWorld
  62.        
  63.         Text 0,0, mywidth$
  64.         Text 0,15, myheight$
  65.  
  66.         Flip(True)
  67. Wend
  68. End


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal