Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. DirectX9 - Problems to arrange bitmap

DirectX9 - Problems to arrange bitmap

Scheduled Pinned Locked Moved Graphics
graphicshelplearning
1 Posts 1 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Korowai
    wrote on last edited by
    #1

    Hi, i properly have coded a bitmap to be drawn in a control child of a dialogue in WINAPI. Now i want to fit the bitmap, that has to be bigger than the window size, in specific coordinates, lateron i want to make controls that move the picture in the window. My problem is i really don't know where i can set the variables who arrange the picture. Here's the code (only the main, the headers are not neccessary):

    #if defined(UNICODE) && !defined(_UNICODE)
    #define _UNICODE
    #elif defined(_UNICODE) && !defined(UNICODE)
    #define UNICODE
    #endif

    #include
    #include
    #include
    #include
    #include
    #include "Resource.h"

    #pragma comment (lib, "d3d9.lib")

    /* Declare Windows procedure */
    LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
    BOOL CALLBACK Raumaktionproc (HWND, UINT, WPARAM, LPARAM);

    /* Make the class name into a global variable */

    = _T("CodeBlocksWindowsApp");

    LPDIRECT3D9 d3d;
    LPDIRECT3DDEVICE9 d3ddev;
    LPDIRECT3DVERTEXBUFFER9 g_pVertexBuffer = NULL;
    LPDIRECT3DTEXTURE9 g_pTexture = NULL;

    #define D3DFVF_CUSTOMVERTEX ( D3DFVF_XYZ | D3DFVF_TEX1 )

    struct Vertex
    {
    float x, y, z;
    float tu, tv;
    };

    Vertex g_quadVertices[] =
    {
    {-1.0f, 1.0f, 0.0f, 0.0f,0.0f },
    { 1.0f, 1.0f, 0.0f, 1.0f,0.0f },
    {-1.0f,-1.0f, 0.0f, 0.0f,1.0f },
    { 1.0f,-1.0f, 0.0f, 1.0f,1.0f }
    };
    static HWND hwndRaumkarte;

    void initD3D(HWND hwndRaumkarte);
    void render_frame(void);
    void cleanD3D(void);
    void loadTexture(void);

    #define ID_StartDialog 1

    int WINAPI WinMain (HINSTANCE hThisInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpszArgument,
    int nCmdShow)
    {
    HWND hwnd; /* This is the handle for our window */
    MSG messages; /* Here messages to the application are saved */
    WNDCLASSEX wincl; /* Data structure for the windowclass */

    memset(&messages,0,sizeof(messages));
    
    /\* The Window structure \*/
    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /\* This function is called by windows \*/
    wincl.style = CS\_DBLCLKS;                 /\* Catch double-clicks \*/
    wincl.cbSize = sizeof (WNDCLASSEX);
    
    /\* Use default icon and mouse-pointer \*/
    wincl.hIcon = LoadIcon (NULL, IDI\_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI\_APPLICATION);
    wincl.hCur
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups