Author Topic: MayaMotor ...how to swap buffers?  (Read 4061 times)

0 Members and 1 Guest are viewing this topic.

Offline Aurel

  • Forum Regular
  • Posts: 167
    • View Profile
MayaMotor ...how to swap buffers?
« on: February 10, 2021, 03:05:43 pm »
Hi
here is a program made  by me ,Ed Davis translated to QB64...
but i don't know how to get proper effect ?
I am using SWAP function in my interpreter so...
is there something similar in QB64...
i hope that B+ have solution(option)....

Code: QB64: [Select]
  1. 'Translated from: maya_motor in micro(A)
  2. SCREEN _NEWIMAGE(600, 600, 32)
  3. color _rgb(200,220,250), _rgb(0, 0, 0)
  4. pi = 3.14
  5. level = 300 : angle = 0
  6. x1=200 : y1=200
  7.  
  8.  
  9. for n = 0 to 1999
  10.   angle = angle - 20
  11.    for i = 1 to 99
  12.      d=9
  13.      x2 = x1 + cos(angle/d) * (d*10)
  14.      y2 = y1 + sin(angle*d) * (d*10)
  15.      rr=200-d*10 : gg=190-d : bb= 220
  16.      color _rgb(rr,gg,bb)
  17.      'Line x2,y2,x1,y1
  18.      circle (x2,y2),d
  19.      angle = angle + 20
  20.      d=d-1
  21.      _delay .01
  22.    next
« Last Edit: February 10, 2021, 03:44:07 pm by Aurel »
//////////////////////////////////////////////////////////////////
https://aurelsoft.ucoz.com
https://www.facebook.com/groups/470369984111370
//////////////////////////////////////////////////////////////////

Offline odin

  • Administrator
  • Newbie
  • Posts: 92
  • I am.
    • View Profile
Re: MayaMotor ...how to swap buffers?
« Reply #1 on: February 10, 2021, 03:44:50 pm »
Not valid QB64 code.

Offline Aurel

  • Forum Regular
  • Posts: 167
    • View Profile
Re: MayaMotor ...how to swap buffers?
« Reply #2 on: February 10, 2021, 03:45:28 pm »
now is valid...sorry i made mistake,...
//////////////////////////////////////////////////////////////////
https://aurelsoft.ucoz.com
https://www.facebook.com/groups/470369984111370
//////////////////////////////////////////////////////////////////

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: MayaMotor ...how to swap buffers?
« Reply #3 on: February 10, 2021, 03:52:10 pm »
Hi
here is a program made  by me ,Ed Davis translated to QB64...
but i don't know how to get proper effect ?
I am using SWAP function in my interpreter so...
is there something similar in QB64...
i hope that B+ have solution(option)....

Code: QB64: [Select]
  1. 'Translated from: maya_motor in micro(A)
  2. SCREEN _NEWIMAGE(600, 600, 32)
  3. color _rgb(200,220,250), _rgb(0, 0, 0)
  4. pi = 3.14
  5. level = 300 : angle = 0
  6. x1=200 : y1=200
  7.  
  8.  
  9. for n = 0 to 1999
  10.   angle = angle - 20
  11.    for i = 1 to 99
  12.      d=9
  13.      x2 = x1 + cos(angle/d) * (d*10)
  14.      y2 = y1 + sin(angle*d) * (d*10)
  15.      rr=200-d*10 : gg=190-d : bb= 220
  16.      color _rgb(rr,gg,bb)
  17.      'Line x2,y2,x1,y1
  18.      circle (x2,y2),d
  19.      angle = angle + 20
  20.      d=d-1
  21.      _delay .01
  22.    next

This code does work in dev 1.5 as of 3:47 edit
 
Aurel code.PNG


Nice little snip.

@Aurel What is it you want it to do? Swap what?
« Last Edit: February 10, 2021, 04:04:05 pm by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: MayaMotor ...how to swap buffers?
« Reply #4 on: February 10, 2021, 04:36:21 pm »
Here's a mod:
Code: QB64: [Select]
  1. 'Translated from: maya_motor in micro(A)   mod by b+ 2021-02-10
  2. Screen _NewImage(400, 400, 32)
  3. _Delay .25
  4.  
  5. level = 300: angle = 0: x1 = 200: y1 = 200
  6.     n = n + 1: angle = angle - 20
  7.     For i = 1 To 99
  8.         Line (0, 0)-(_Width, _Height), &H08000000, BF
  9.         d = 9
  10.         x2 = x1 + Cos(angle / d) * (d * 10)
  11.         y2 = y1 + Sin(angle * d) * (d * 10)
  12.         rr = 255 - i * 2: gg = 255: bb = i * 2
  13.         Circle (x2, y2), d, _RGB32(rr, gg, bb)
  14.         angle = angle + 20
  15.         d = d - 1
  16.         _Limit 480
  17.     Next
  18.  
  19.  

Offline Aurel

  • Forum Regular
  • Posts: 167
    • View Profile
Re: MayaMotor ...how to swap buffers?
« Reply #5 on: February 10, 2021, 05:45:53 pm »
Quote
What is it you want it to do? Swap what?

as you probably know i use gdi ...so i swap back buffer to front

like this...





2021-02-10_234510.png
* 2021-02-10_234510.png (Filesize: 5.76 KB, Dimensions: 345x310, Views: 244)
//////////////////////////////////////////////////////////////////
https://aurelsoft.ucoz.com
https://www.facebook.com/groups/470369984111370
//////////////////////////////////////////////////////////////////

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: MayaMotor ...how to swap buffers?
« Reply #6 on: February 10, 2021, 05:48:27 pm »
@Aurel checkout pcopy in Wiki, the old way of flipping screens.

wiki:
Quote
The QB64 _DISPLAY statement can also be used to stop screen flicker without page flipping or CLS and is the recommended practice.
« Last Edit: February 10, 2021, 07:00:25 pm by bplus »