2014-11-24 2 views
-2

그래픽 프로젝트에 관한 몇 가지 사항을 설정해야하는 프로젝트가 있는데, 어떻게 사용하는지 잘 모르는 vbe.h 파일이 있습니다.VBE.h 질문들이 많습니다.

#ifndef __VBE_H 
#define __VBE_H 

#include <stdint.h> 

/** @defgroup vbe vbe 
* @{ 
* 
* Functions related to the VBE standard 
*/ 

/** @name VBE Mode Info Block */ 
/**@{ 
* 
* Packed VBE Mode Info Block 
*/ 

typedef struct { 
    /* Mandatory information for all VBE revisions */ 
    uint16_t ModeAttributes; /**< @brief mode attributes */ 
    uint8_t WinAAttributes;  /**< @brief window A attributes */ 
    uint8_t WinBAttributes;  /**< @brief window B attributes */ 
    uint16_t WinGranularity; /**< @brief window granularity */ 
    uint16_t WinSize;  /**< @brief window size */ 
    uint16_t WinASegment;  /**< @brief window A start segment */ 
    uint16_t WinBSegment;  /**< @brief window B start segment */ 
    phys_bytes WinFuncPtr; /**< @brief real mode/far pointer to window function */ 
    uint16_t BytesPerScanLine; /**< @brief bytes per scan line */ 

    /* Mandatory information for VBE 1.2 and above */ 

    uint16_t XResolution;   /**< @brief horizontal resolution in pixels/characters */ 
    uint16_t YResolution;   /**< @brief vertical resolution in pixels/characters */ 
    uint8_t XCharSize;  /**< @brief character cell width in pixels */ 
    uint8_t YCharSize;  /**< @brief character cell height in pixels */ 
    uint8_t NumberOfPlanes;  /**< @brief number of memory planes */ 
    uint8_t BitsPerPixel;   /**< @brief bits per pixel */ 
    uint8_t NumberOfBanks;  /**< @brief number of banks */ 
    uint8_t MemoryModel;  /**< @brief memory model type */ 
    uint8_t BankSize;  /**< @brief bank size in KB */ 
    uint8_t NumberOfImagePages; /**< @brief number of images */ 
    uint8_t Reserved1;  /**< @brief reserved for page function */ 

    /* Direct Color fields (required for direct/6 and YUV/7 memory models) */ 

    uint8_t RedMaskSize;  /* size of direct color red mask in bits */ 
    uint8_t RedFieldPosition; /* bit position of lsb of red mask */ 
    uint8_t GreenMaskSize;  /* size of direct color green mask in bits */ 
    uint8_t GreenFieldPosition; /* bit position of lsb of green mask */ 
    uint8_t BlueMaskSize;   /* size of direct color blue mask in bits */ 
    uint8_t BlueFieldPosition; /* bit position of lsb of blue mask */ 
    uint8_t RsvdMaskSize;  /* size of direct color reserved mask in bits */ 
    uint8_t RsvdFieldPosition; /* bit position of lsb of reserved mask */ 
    uint8_t DirectColorModeInfo; /* direct color mode attributes */ 

    /* Mandatory information for VBE 2.0 and above */ 
    phys_bytes PhysBasePtr;  /**< @brief physical address for flat memory frame buffer */ 
    uint8_t Reserved2[4];   /**< @brief Reserved - always set to 0 */ 
    uint8_t Reserved3[2];   /**< @brief Reserved - always set to 0 */ 

    /* Mandatory information for VBE 3.0 and above */ 
    uint16_t LinBytesPerScanLine; /* bytes per scan line for linear modes */ 
    uint8_t BnkNumberOfImagePages; /* number of images for banked modes */ 
    uint8_t LinNumberOfImagePages; /* number of images for linear modes */ 
    uint8_t LinRedMaskSize;   /* size of direct color red mask (linear modes) */ 
    uint8_t LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */ 
    uint8_t LinGreenMaskSize;  /* size of direct color green mask (linear modes) */ 
    uint8_t LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */ 
    uint8_t LinBlueMaskSize; /* size of direct color blue mask (linear modes) */ 
    uint8_t LinBlueFieldPosition;  /* bit position of lsb of blue mask (linear modes) */ 
    uint8_t LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */ 
    uint8_t LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */ 
    uint32_t MaxPixelClock;   /* maximum pixel clock (in Hz) for graphics mode */ 
    uint8_t Reserved4[190];  /* remainder of ModeInfoBlock */ 
} __attribute__((packed)) vbe_mode_info_t; 

/** @} end of vbe_mode_info_t*/ 

/** 
* @brief Returns information on the input VBE mode, including screen dimensions, color depth and VRAM physical address 
* 
* Initializes unpacked vbe_mode__info_t structure passed as an address with 
* the information of the input mode, by calling VBE function 0x01 
* Return VBE Mode Information and unpacking the ModeInfoBlock struct 
* returned by that function. 
* 
* @param mode mode whose information should be returned 
* @param vmi_p address of vbe_mode_info_t structure to be initialized 
* @return 0 on success, non-zero otherwise 
*/ 
int vbe_get_mode_info(unsigned short mode, vbe_mode_info_t *vmi_p); 

/** @} end of vbe */ 

#endif /* __VBE_H */ 
나는 등 RedMaskSize, RedFieldPosition와 같은이 일부 기능을 사용합니까 방법을 알고 싶습니다

. 어떤 생각?

관련

이 하나의 기능, vbe_get_mode_info 거기
+0

더 나은 제목 찾기 – displayname

답변

-3

. 당신은 그것을 모드를 제공, 당신의 구조에 대한 포인터를 호출하고 당신을 위해 구조를 채우는 :

vbe_mode_info_t params; 
vbe_get_mode_info(0 /* guess at a mode */, &params); 

// now you can use params.RedMaskSize for example as you want 

컴파일 할 때 라이브러리를 링크해야합니다을이 일에 대한 문서는 여기에 있습니다 : http://web.fe.up.pt/~pfs/aulas/lcom2011/labs/lab2/doc/group__vbe.html

+0

부수적으로이 질문은 완벽한 마감 후보입니다. "VBE"는이 라이브러리의 특정 이름이 아니며, 이미 널리 사용되는 두문자어이며 사용자는 아무런 내용도 제공하지 않습니다. – Blindy

+0

죄송합니다. 이름을 바꾸고 싶습니다. 가능한가? 하지만 이러한 옵션을 모두 얻으려면 어떻게해야합니까? 가능한가? – Verance