Solved

Graphics in Windows

Posted on 1998-11-21
6
209 Views
Last Modified: 2010-04-01
Ok. I got a block of memory, char [640][480], and every character in it represents a pixel color. I want to blit this block of data to the screen. I know how to, using memcpy, but how do i get in in the right mode? I want to do this all from windows, remember. I want full screen graphics, and a mouse. I would prefer not to use DirectX. Any suggestions, site referances, code...anything? Thanks-
ty
0
Comment
Question by:TRM
  • 3
  • 2
6 Comments
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1178410
You must use for this Windows API:
BitBlt/StretchBlt. For create Bitmap you can use
CreateBitmapIndirect. But before this
you must learn any book
about Windows/Bitmaps/DIB and so on.(I recomend you
Petzold or Tom Swan books). In this boks there are many
examples of Display Bitmaps, make colors ...
Regards, Alex
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1178411
If you already have the array setup, then look at SetDIBitsToDevice and StretchDIBits.  

Quite a few examples on these two.

Phillip
0
 

Author Comment

by:TRM
ID: 1178412
i need more information on how to allow my program to use all of The screen. I want it to be the only posssible window on the screen, say, like C&C Red Alert. It takes up full screen. Do i need to change modes to allow read/write to that memory? "How do i get my program to run unwindowed full screen" is basicly what i'm asking.
thanks for the time
ty
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:TRM
ID: 1178413
i need more information on how to allow my program to use all of The screen. I want it to be the only posssible window on the screen, say, like C&C Red Alert. It takes up full screen. Do i need to change modes to allow read/write to that memory? "How do i get my program to run unwindowed full screen" is basicly what i'm asking.
thanks for the time
ty
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 250 total points
ID: 1178414
For cretion you main Window, you must use
WS_POPUP style, as in example:

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
     {
     static char szAppName[] = "HelloWin" ;
     HWND        hwnd ;
     MSG         msg ;
     WNDCLASS  wndclass ;

     wndclass.style         = CS_HREDRAW | CS_VREDRAW ;
     wndclass.lpfnWndProc   = WndProc ;
     wndclass.cbClsExtra    = 0 ;
     wndclass.cbWndExtra    = 0 ;
     wndclass.hInstance     = hInstance ;
     wndclass.hIcon         = LoadIcon (NULL, IDI_APPLICATION) ;
     wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
     wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
     wndclass.lpszMenuName  = NULL ;
     wndclass.lpszClassName = szAppName ;

     RegisterClass (&wndclass) ;

     hwnd = CreateWindow (szAppName,// window class name
                "Hello Program",     // window caption
                WS_POPUP,     // window style
                0,           // initial x position
                0,           // initial y position
                640,           // initial x size
                480,           // initial y size
                NULL,
                NULL,
                hInstance,
                NULL) ;

     ShowWindow (hwnd, iCmdShow) ;
     UpdateWindow (hwnd) ;

     while (GetMessage (&msg, NULL, 0, 0))
          {
          TranslateMessage (&msg) ;
          DispatchMessage (&msg) ;
          }
     return msg.wParam ;
     }
After that you can display you text/Bitmap/Lines ... for
full screen.
Regards, Alex


0
 

Author Comment

by:TRM
ID: 1178415
Wow. That's Alot. Exactly what i was lookin for. Thanks, hope the points help. <g> ;)
Ty R. M.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question