Talk:Resource Tracking for FlightGear: Difference between revisions

Jump to navigation Jump to search
m
Line 24: Line 24:


     virtual int getVRAMUsageInKB() {
     virtual int getVRAMUsageInKB() {
    SG_LOG(SG_GENERAL, SG_ALERT,"NVIDIA Function not yet implemented !");
     return 100;
     return 100;
     }
     }
Line 31: Line 32:
     class ATI_GPU: public GPUInfo {
     class ATI_GPU: public GPUInfo {
     virtual int getVRAMUsageInKB() {
     virtual int getVRAMUsageInKB() {
    SG_LOG(SG_GENERAL, SG_ALERT,"ATI Function not yet implemented !");
     return 200;
     return 200;
     }
     }
Line 39: Line 41:


     virtual int getVRAMUsageInKB() {
     virtual int getVRAMUsageInKB() {
    SG_LOG(SG_GENERAL, SG_ALERT,"Intel Function not yet implemented !");
     return 500;
     return 500;
     }
     }
Line 46: Line 49:
</syntaxhighlight>
</syntaxhighlight>


(100/200 and 300 would be replaced with the corresponding code)
(100/200 and 500 would be replaced with the corresponding code)


In the LinuxMemoryInterface::LinuxMemoryInterface constructor, it would need to read the gpu-vendor property (as per the help/about dialog) and instantiate the correct class,  by adding a pointer to it that holds the class:
In the LinuxMemoryInterface::LinuxMemoryInterface() constructor, it would need to read the gpu-vendor property (as per the help/about dialog) and instantiate the correct class,  by adding a pointer to it that holds the object:


<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
Line 79: Line 82:
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
     + MemoryInterface() {
     + MemoryInterface() {
     + SG_LOG(SG_GENERAL, SG_ALERT, "Check for GPU vendor here");
     + SG_LOG(SG_GENERAL, SG_ALERT, "TODO: Check for GPU vendor here, and dynamically allocate correct class");
     + }
     + }


Navigation menu