12.07.2015 Views

Chapter Quiz

Chapter Quiz

Chapter Quiz

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Taking Dev-C++ and Allegro for a Spin 61Table 2.2 Processor Features Identified by AllegroIdentifierDescriptionCPU_IDcpuid is available.CPU_FPUx87 FPU is available.CPU_MMXMMX is available.CPU_MMXPLUSMMX+ is available.CPU_SSESSE is available.CPU_SSE2SSE2 is available.CPU_3DNOW3DNow! is available.CPU_ENH3DNOWEnhanced 3DNow! is available.int caps = cpu_capabilities;printf(“Processor ID= %s\n”,YesNo((caps & CPU_ID)==CPU_ID));printf(“x87 FPU= %s\n”,YesNo((caps & CPU_FPU)==CPU_FPU));printf(“MMX= %s\n”,YesNo((caps & CPU_MMX)==CPU_MMX));printf(“MMX+= %s\n”,YesNo((caps & CPU_MMXPLUS)==CPU_MMXPLUS));printf(“SSE= %s\n”,YesNo((caps & CPU_SSE)==CPU_SSE));printf(“SSE2= %s\n”,YesNo((caps & CPU_SSE2)==CPU_SSE2));printf(“3DNOW= %s\n”,YesNo((caps & CPU_3DNOW)==CPU_3DNOW));printf(“Enhanced 3DNOW= %s\n”,YesNo((caps & CPU_ENH3DNOW)==CPU_ENH3DNOW));For reference, here is the complete listing for the main function of GetInfo, with some additionalcomments to clarify what each section of code is doing.int main() {//initialize Allegroallegro_init();//display version infoprintf(“Allegro versionprintf(“Operating system= %s\n”, allegro_id);= %s\n”, OSName(os_type));

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!