Programación General > C/C++

 Modo De Video

(1/2) > >>

JuanK:
Saludos..
estoy haciendo un ejercicio de programacion de lenguaje c,
el problema es que estoy utilizando funciones que solia utilizar para cambiar el modo de video, estas usaban la dos.h.. bien esta libreria ya no existe o mejor ya no funciona para programar en windows xp asi que tambien tenia de hace ya unos años una funcion que hice en assembler que hacia lo mismo , pero no me funciona tampoco..
solo me han funcionado utilizando el compilador DJGPP porque emula el entorno del dos.. pero al compilarlo en visual studio no me funcionan :'(

alguien sabe como hacer para cambiar el modo de video en lenguaje c, utilizando visual studio.net y sin utilizar librerias como allegro o directX... ?'
es decir
alguien sabe como ouedo hacer esto con codigo de bajo nivel...??


cabe aclarar que utilizo windows xp professional.


agradezco cualquier ayuda.

gracias

JuanK:
bueno ..
creo que se debe poder con la api de windows...
ya veremos..
siono con el ddkl de microsoft aunqeu eso implicaria hacer mi propio driver... :@

sigo aceptando ideas... please...

JuanK:
solucion:
si a travez de la api de windows utilizando gdi :)

ya he investigado suficiente asi que hasta mañana muchachos
ya no se usa la dos.h pero si windows.h(winapi) alli estan las herramientas que necesito para utilizar los recursos de la maquina.

JuanK:
bueno, caeria bien que de vez en cuando alguien me ayudara a mi!!!  :unsure:

bueno ya investigue bastantede gdi y de la api de windows, pero no me gusto mucho trabajar asi el modo grafico... es muy 'feo' de usar, aqui un pequeño ejemplo de tantos que hice:
más abajo esta el ejecutable

--- Código: Text --- #include<stdio.h> #include<windows.h>  int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int ); LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); int makeAllScreenWindow(HWND , HINSTANCE , int );  char WindowName[]  = "Bitmap"; char WindowTitle[] = "Bitmap"; int x=10, y=10, Hres, Vres, speedy=5, speedx=10; HDC hdc, hdcMem, hdcMemBackUp; HGDIOBJ hbm,hbmBK;   int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,                 LPSTR lpCmdLine, int nCmdShow ) {     MSG msg;    HWND hwnd=NULL;     makeAllScreenWindow(hwnd,hInstance,nCmdShow );     hdc = CreateDC( "DISPLAY", NULL, NULL, NULL );     Hres=GetDeviceCaps(hdc, HORZRES);    Vres=GetDeviceCaps(hdc, VERTRES);    hdcMem = CreateCompatibleDC(hdc);    hdcMemBackUp = CreateCompatibleDC(hdc);    hbm  = CreateCompatibleBitmap(hdc, Hres, Vres);    hbmBK = CreateCompatibleBitmap(hdc, Hres, Vres);    SelectObject(hdcMemBackUp, hbmBK);    SelectObject(hdcMem, hbm);     BitBlt(hdcMemBackUp,0,0,Hres, Vres  , hdc, 0,0, SRCCOPY);     while( GetMessage( &msg, NULL, 0, 0 ) )    {       TranslateMessage( &msg );       DispatchMessage( &msg );    }    BitBlt(hdc,0,0,Hres, Vres  , hdcMemBackUp, 0,0, SRCCOPY);    DeleteDC( hdcMemBackUp );    DeleteDC( hdcMem );    DeleteDC( hdc );    return( msg.wParam ); }  LRESULT CALLBACK WndProc( HWND hwnd, UINT message,  WPARAM wParam, LPARAM lParam ) {    switch( message )    {       case WM_PAINT:             TextOut( hdcMem, 0, 0, "Ejemplo GDI, presione escape para salir",39);             Rectangle (hdcMem,x,y,x+100,y+100);              if(x+100>Hres)                speedx*=(-1);              if(y+100>Vres)                speedy*=(-1);              if(x<=0)                speedx*=(-1);             if(y<=0)                speedy*=(-1);             x+=speedx;             y+=speedy;                          if(!BitBlt(hdc,0,0, Hres, Vres, hdcMem, 0,0, SRCCOPY))                TextOut( hdc, 0, 0, "Fallo al escribiir en hdc desde hdcmem",33);       break;       case WM_KEYDOWN:          switch(wParam)          {             case VK_ESCAPE:                DestroyWindow( hwnd );             break;             default:                break;          }       break;       case WM_DESTROY:           PostQuitMessage( 0 );        break;         default:          return( DefWindowProc( hwnd, message, wParam, lParam ) );     }     return(0); }     int makeAllScreenWindow(HWND hwnd, HINSTANCE hInstance, int nCmdShow) {    WNDCLASSEX wcx;        wcx.cbSize = sizeof( WNDCLASSEX );    wcx.style = CS_HREDRAW | CS_VREDRAW;    wcx.lpfnWndProc = WndProc;    wcx.cbClsExtra = 0;    wcx.cbWndExtra = 0;    wcx.hInstance = hInstance;           wcx.hIcon = LoadIcon(NULL, IDI_WINLOGO);    wcx.hCursor = LoadCursor(NULL, IDC_ARROW);    wcx.hbrBackground = (HBRUSH) GetStockObject( WHITE_BRUSH );    wcx.hIconSm = LoadIcon(NULL, IDI_WINLOGO);    wcx.lpszClassName = WindowName;    wcx.lpszMenuName = NULL;     if( !RegisterClassEx( &wcx ) )       return( FALSE );     hwnd = CreateWindowEx(         WS_EX_OVERLAPPEDWINDOW,       WindowName, WindowTitle,       WS_POPUP              ,       0, 0,1, 1, NULL, NULL,       hInstance, NULL);      if( !hwnd )        return( FALSE );    ShowWindow( hwnd, nCmdShow );    return TRUE; }   

QliX=D!:
Feo en qeu sentido JK? perdon por no haberte respondido antes :D

Navegación

[0] Índice de Mensajes

[#] Página Siguiente

Ir a la versión completa