Qbasicnews.com
A new project I've been busy with :-) - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html)
+--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html)
+---- Forum: FB Projects (http://qbasicnews.com/newforum/forum-16.html)
+---- Thread: A new project I've been busy with :-) (/thread-9357.html)

Pages: 1 2 3


A new project I've been busy with :-) - na_th_an - 06-25-2006

That's cause it's designed to be run from terminals. Each terminal can be very different to another. Some allow text decorations, some allow a number of colours, some of them need fixed colour values, some other can define R,G,B intensities... That's why ncurses is so awkward.

I misread the message, that's why I posted that silly formula that works in MSDOS if you configure the VGA to deactivate blink thus being able to display all the 16 background colours.

http://www.apmaths.uwo.ca/~xli/ncurses.html#attribute


A new project I've been busy with :-) - Anonymous - 06-25-2006

Thanks for the link, but I have already figured it out, like I said. Here's code proof:


Code:
Sub curses_InitColorTable()
    
    Dim As Integer y, x, c
  
    For y = 0 To 15
      
      For x = 0 To 7
      
          c += 1
          init_pair( c, x, y )
  
        Next
        
      Next
    
  End Sub

  Private Sub con_Blitter( conBlit As con_Core Ptr )
  
    
    Dim As Integer y, x
    
    With *( conBlit )
  
      Dim As chType charBlit
      
      move( 0, 0 )
  
      For y = 0 To .con_y - 1
        '' rows
          
        For x = 0 To .con_x - 1
          '' columns
          
  
          With .con_Data[y][x]
  
            charBlit = IIf( _
                            .char = 0, _
                            32    Or color_pair( ( .bcol Shl 3 ) + 1 ), _
                            .char Or color_pair( ( .bcol Shl 3 ) + 1 + ( .fcol And &b0111 ) ) Or IIf( .fcol And &b1000, a_bold, 0 ) _
                          )
            
            addch( charBlit )
            
                      
          End With
          
      
        Next
        
      Next
  
    End With
    
    refresh '' curses ...
  
  End Sub

One thing MS did right was making that formula for hitting all colors so easy Tongue


A new project I've been busy with :-) - na_th_an - 07-03-2006

Well, having a VGA or a VGA clone it's easy to do thing "that right" Wink Big Grin