Creating Patterns

This is a discussion on Creating Patterns within the Game Programming forums, part of the General Programming Boards category; This function Code: The glLineStipple function specifies the line stipple pattern. void glLineStipple( GLint factor, GLushort pattern ); Parameters factor ...

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    Creating Patterns

    This function

    Code:
    The glLineStipple function specifies the line stipple pattern.
    
    void glLineStipple(
    
        GLint factor, 	
        GLushort pattern 	
       );	
     
    
    Parameters
    
    factor
    
    A multiplier for each bit in the line stipple pattern. 
    If factor is 3, for example, each bit in the pattern 
    will be used three times before the next bit in the pattern is used.
     The factor parameter is clamped to the range [1, 256] and defaults to one.
    
    pattern 
    
    A 16-bit integer whose bit pattern determines
     which fragments of a line will be drawn when 
    the line is rasterized. Bit zero is used first, and the default pattern is all ones.

    Well I want to learn how to make those patterns, can't find anything on it online, any ideas?
    Last edited by incognito; 03-15-2003 at 09:06 PM.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    example.

    Code:
      GLubyte mask[] = {
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x7, 0xFF, 0xF0, 0x0,
        0x1F, 0xE0, 0x1E, 0x0,
        0x7E, 0x20, 0x01, 0x0,
        0x7F, 0x39, 0xAB, 0x6F,
        0xFC, 0xA6, 0xAB, 0x6F,
        0xF8, 0x66, 0x6E, 0xEC,
        0xF8, 0x6A, 0x2A, 0x6C,
        0xFC, 0x80, 0x02, 0x2C,
        0x7F, 0x0, 0x1, 0xC8,
        0x7F, 0x0, 0x1, 0xC8,
        0x1F, 0xC0, 0x0C, 0x0,
        0x07, 0xFF, 0xF0, 0x0,
        0x03, 0xFF, 0xE0, 0x0,
        0x0, 0x1C, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0,
        0x0, 0x0, 0x0, 0x0
      };

    I don't really know how he does this, or what these lines mean...............

    It's from OpenGL Game Programming.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  3. #3
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Show some code...
    eg. where this array is passed to the glLineStipple function.

  4. #4
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Thanks I already know the answer.............I wasn't this code in any place in particular, just trying to learn.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  5. #5
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    so you dont need an explaination?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  6. #6
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Well thanks no one but, I posted a thread at the C++ board and keep searching, and I've sort of came up with an answer to my question. Thanks anyhow.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. creating an application
    By Cpro in forum C++ Programming
    Replies: 21
    Last Post: 05-30-2008, 12:21 AM
  3. Creating a rain effect...
    By Raigne in forum Game Programming
    Replies: 11
    Last Post: 12-04-2007, 04:30 PM
  4. Cprog tutorial: Design Patterns
    By maes in forum C++ Programming
    Replies: 7
    Last Post: 10-11-2004, 01:41 AM
  5. Creating Bullet Patterns
    By The Dog in forum Game Programming
    Replies: 9
    Last Post: 10-30-2003, 02:33 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21