2016-03-06 46 views
2

因此,我試圖通過WinAPI函數獲取有關顯卡的信息,但在如何獲取我的確切卡信息方面存在疑問。我已經編寫代碼來調用EnumDisplayDevices,並通過我的電話接收DeviceString「Intel(R)HD Graphics Family」。但是,這並不能告訴我確切的卡片,例如英特爾高清顯卡系列有4200,4400等等(根據我的理解)。通過WinAPI確定英特爾高清顯卡版本

我搜索了更多關於如何找到這些信息的方法,甚至通過註冊表查看仍然使我得到「英特爾(R)高清顯卡系列」的描述字符串......現在我在這裏。非常感謝任何人誰可以幫我,這是一個逸岸計算器線程害得我在EnumDisplayDevices的擺在首位:)

+1

型號是否暴露在Windows中的任何位置,您都可以看到? (例如在設備管理器中?)。如果不是,它可能根本不會將該信息報告給操作系統。 –

+0

沒有設備管理器給我相同的通用描述沒有確切的型號,我會給OpenGL一個嘗試。 –

回答

1

的方向,我會用OpenGL的代替WinAPI的這個,因爲我不知道如果WinAPI甚至有這樣的一些功能,懶得研究。是的,您可以搜索註冊表項來獲取此信息,但由於可能的位置/名稱更改,將來不安全。該OpenGL的方式是直截了當:

  1. 創建的OpenGL渲染上下文
  2. 獲得相應的供應商和設備字符串。
  3. 發佈的OpenGL渲染上下文

它將爲任何的OpenGL能夠顯卡/驅動程序支持OpenGL的1.0這是所有時下卡。

您可以使用OpenGL的功能glGetString獲得該信息:

GL_VENDOR Returns the company responsible for this OpenGL implementation. This name does not change from release to release. 
GL_RENDERER Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release. 
GL_VERSION Returns a version or release number (of supported OpenGL and gfx driver version) 
GL_EXTENSIONS Returns a space-separated list of supported extensions to OpenGL (all capabilities of your card) 

都好辦(使用gl_init,gl_exit從第二鏈接):

gl_init(Your_App_Window_Handle); 
char *vendor =(char*)glGetString(GL_VENDOR); 
char *device =(char*)glGetString(GL_RENDERER); 
char *version=(char*)glGetString(GL_VERSION); 
char *ext =(char*)glGetString(GL_EXTENSIONS); 
gl_exit(); 

礦設置的回報:

vendor ="NVIDIA Corporation" 
device ="GeForce GTX 550 Ti/PCIe/SSE2" 
version="4.5.0 NVIDIA 347.25" 
ext ="GL_AMD_multi_draw_indirect GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_ES3_1_compatibility GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_NV_internalformat_sample_query GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_draw_parameters GL 

[注意事項]

你需要包括只適用於本gl.h不需要glu,glew或其他任何東西(除了wglext.h應該包括在其擁有gl.h)。它通常位於單獨的包含子目錄中,如:

#include <gl\gl.h> 
+0

我會檢查出OpenGL,看看它是如何去做的,如果它能解決問題,我會接受這個答案。非常感謝所有的信息! –

相關問題