Results 1 to 40 of 50

Thread: C++ Created DLL File To Use In VB6

Threaded View

  1. #21
    The Idiot
    Join Date
    Dec 2014
    Posts
    3,013

    Re: C++ Created DLL File To Use In VB6

    I asked Poe, here what I got:

    Code:
    Declare Function NvAPI_Initialize Lib "nvapi.dll" () As Long
    Declare Function NvAPI_EnumPhysicalGPUs Lib "nvapi.dll" (ByRef gpuHandles As Long, ByRef gpuCount As Long) As Long
    Declare Function NvAPI_GPU_SetEDID Lib "nvapi.dll" (ByVal gpuHandle As Long, ByVal displayPath As Long) As Long
    ```
    Public Sub EnableNvOptimus()
        Dim nvapiInitResult As Long
        Dim gpuHandles(1 To 10) As Long ' Adjust the array size as per your requirement
        Dim gpuCount As Long
        
        nvapiInitResult = NvAPI_Initialize()
        
        If nvapiInitResult = 0 Then
            NvAPI_EnumPhysicalGPUs VarPtr(gpuHandles(1)), gpuCount
            
            If gpuCount > 0 Then
                NvAPI_GPU_SetEDID gpuHandles(1), 0 ' Set the displayPath parameter as per your requirement
            End If
        End If
    End Sub
    now Im not sure if this works.
    also asked about it and here the answer:
    When using Direct2D, the NvOptimusEnablement setting is not directly applicable because it specifically pertains to NVIDIA Optimus technology, which is primarily used for switching between integrated and discrete GPUs on laptops to optimize power consumption. Since Direct2D runs primarily on the GPU, it already leverages the power of the GPU for rendering, regardless of whether you choose hardware or software mode.

    In hardware mode, Direct2D will utilize the GPU for rendering, which can provide faster performance and take advantage of GPU memory. This mode is usually recommended for most scenarios, especially if your system has a dedicated GPU.

    In software mode, Direct2D operates using the CPU and system memory for rendering. While it may be useful in certain situations, such as when you don't have a dedicated GPU or need to perform specific CPU-based operations, it generally results in slower performance compared to hardware mode.

    In summary, when using Direct2D, you can choose between hardware and software modes based on your specific requirements. NvOptimusEnablement is not directly applicable to Direct2D, as it is primarily relevant to GPU switching on laptops.
    Last edited by baka; Oct 21st, 2023 at 02:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width