diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL.xcodeproj/project.xcworkspace/xcuserdata/hxssg.xcuserdatad/UserInterfaceState.xcuserstate" "b/21551047\351\273\204\351\221\253/MyOpenGL.xcodeproj/project.xcworkspace/xcuserdata/hxssg.xcuserdatad/UserInterfaceState.xcuserstate" index 46634a0..e03adce 100644 Binary files "a/21551047\351\273\204\351\221\253/MyOpenGL.xcodeproj/project.xcworkspace/xcuserdata/hxssg.xcuserdatad/UserInterfaceState.xcuserstate" and "b/21551047\351\273\204\351\221\253/MyOpenGL.xcodeproj/project.xcworkspace/xcuserdata/hxssg.xcuserdatad/UserInterfaceState.xcuserstate" differ diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.pbxproj" "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..8cec7d7 --- /dev/null +++ "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.pbxproj" @@ -0,0 +1,266 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C4CA37A71C4CE7A400ADB272 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4CA37A61C4CE7A400ADB272 /* main.cpp */; }; + C4CA37AE1C4CE7B600ADB272 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4CA37AD1C4CE7B600ADB272 /* GLUT.framework */; }; + C4CA37B01C4CE7BB00ADB272 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4CA37AF1C4CE7BB00ADB272 /* OpenGL.framework */; }; + C4CA37B71C4CE7D100ADB272 /* RGBpixmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4CA37B31C4CE7D100ADB272 /* RGBpixmap.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + C4CA37A11C4CE7A400ADB272 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + C4CA37A31C4CE7A400ADB272 /* MyOpenGL2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MyOpenGL2; sourceTree = BUILT_PRODUCTS_DIR; }; + C4CA37A61C4CE7A400ADB272 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + C4CA37AD1C4CE7B600ADB272 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = System/Library/Frameworks/GLUT.framework; sourceTree = SDKROOT; }; + C4CA37AF1C4CE7BB00ADB272 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + C4CA37B11C4CE7D100ADB272 /* earthmap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = earthmap.bmp; sourceTree = ""; }; + C4CA37B21C4CE7D100ADB272 /* moonmap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = moonmap.bmp; sourceTree = ""; }; + C4CA37B31C4CE7D100ADB272 /* RGBpixmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RGBpixmap.cpp; sourceTree = ""; }; + C4CA37B41C4CE7D100ADB272 /* RGBpixmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RGBpixmap.h; sourceTree = ""; }; + C4CA37B51C4CE7D100ADB272 /* SolarSystemGlobals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SolarSystemGlobals.h; sourceTree = ""; }; + C4CA37B61C4CE7D100ADB272 /* sunmap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = sunmap.bmp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C4CA37A01C4CE7A400ADB272 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C4CA37B01C4CE7BB00ADB272 /* OpenGL.framework in Frameworks */, + C4CA37AE1C4CE7B600ADB272 /* GLUT.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C4CA379A1C4CE7A400ADB272 = { + isa = PBXGroup; + children = ( + C4CA37AF1C4CE7BB00ADB272 /* OpenGL.framework */, + C4CA37AD1C4CE7B600ADB272 /* GLUT.framework */, + C4CA37A51C4CE7A400ADB272 /* MyOpenGL2 */, + C4CA37A41C4CE7A400ADB272 /* Products */, + ); + sourceTree = ""; + }; + C4CA37A41C4CE7A400ADB272 /* Products */ = { + isa = PBXGroup; + children = ( + C4CA37A31C4CE7A400ADB272 /* MyOpenGL2 */, + ); + name = Products; + sourceTree = ""; + }; + C4CA37A51C4CE7A400ADB272 /* MyOpenGL2 */ = { + isa = PBXGroup; + children = ( + C4CA37A61C4CE7A400ADB272 /* main.cpp */, + C4CA37B11C4CE7D100ADB272 /* earthmap.bmp */, + C4CA37B21C4CE7D100ADB272 /* moonmap.bmp */, + C4CA37B31C4CE7D100ADB272 /* RGBpixmap.cpp */, + C4CA37B41C4CE7D100ADB272 /* RGBpixmap.h */, + C4CA37B51C4CE7D100ADB272 /* SolarSystemGlobals.h */, + C4CA37B61C4CE7D100ADB272 /* sunmap.bmp */, + ); + path = MyOpenGL2; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C4CA37A21C4CE7A400ADB272 /* MyOpenGL2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = C4CA37AA1C4CE7A400ADB272 /* Build configuration list for PBXNativeTarget "MyOpenGL2" */; + buildPhases = ( + C4CA379F1C4CE7A400ADB272 /* Sources */, + C4CA37A01C4CE7A400ADB272 /* Frameworks */, + C4CA37A11C4CE7A400ADB272 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MyOpenGL2; + productName = MyOpenGL2; + productReference = C4CA37A31C4CE7A400ADB272 /* MyOpenGL2 */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C4CA379B1C4CE7A400ADB272 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = "Huang Xin"; + TargetAttributes = { + C4CA37A21C4CE7A400ADB272 = { + CreatedOnToolsVersion = 7.2; + }; + }; + }; + buildConfigurationList = C4CA379E1C4CE7A400ADB272 /* Build configuration list for PBXProject "MyOpenGL2" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = C4CA379A1C4CE7A400ADB272; + productRefGroup = C4CA37A41C4CE7A400ADB272 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C4CA37A21C4CE7A400ADB272 /* MyOpenGL2 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + C4CA379F1C4CE7A400ADB272 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C4CA37B71C4CE7D100ADB272 /* RGBpixmap.cpp in Sources */, + C4CA37A71C4CE7A400ADB272 /* main.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + C4CA37A81C4CE7A400ADB272 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + C4CA37A91C4CE7A400ADB272 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + }; + name = Release; + }; + C4CA37AB1C4CE7A400ADB272 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + C4CA37AC1C4CE7A400ADB272 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C4CA379E1C4CE7A400ADB272 /* Build configuration list for PBXProject "MyOpenGL2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C4CA37A81C4CE7A400ADB272 /* Debug */, + C4CA37A91C4CE7A400ADB272 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C4CA37AA1C4CE7A400ADB272 /* Build configuration list for PBXNativeTarget "MyOpenGL2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C4CA37AB1C4CE7A400ADB272 /* Debug */, + C4CA37AC1C4CE7A400ADB272 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = C4CA379B1C4CE7A400ADB272 /* Project object */; +} diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.xcworkspace/contents.xcworkspacedata" "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.xcworkspace/contents.xcworkspacedata" new file mode 100644 index 0000000..affbde8 --- /dev/null +++ "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.xcworkspace/contents.xcworkspacedata" @@ -0,0 +1,7 @@ + + + + + diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.xcworkspace/xcuserdata/hxssg.xcuserdatad/UserInterfaceState.xcuserstate" "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.xcworkspace/xcuserdata/hxssg.xcuserdatad/UserInterfaceState.xcuserstate" new file mode 100644 index 0000000..713b7d8 Binary files /dev/null and "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/project.xcworkspace/xcuserdata/hxssg.xcuserdatad/UserInterfaceState.xcuserstate" differ diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/xcuserdata/hxssg.xcuserdatad/xcschemes/MyOpenGL2.xcscheme" "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/xcuserdata/hxssg.xcuserdatad/xcschemes/MyOpenGL2.xcscheme" new file mode 100644 index 0000000..3a29348 --- /dev/null +++ "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/xcuserdata/hxssg.xcuserdatad/xcschemes/MyOpenGL2.xcscheme" @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/xcuserdata/hxssg.xcuserdatad/xcschemes/xcschememanagement.plist" "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/xcuserdata/hxssg.xcuserdatad/xcschemes/xcschememanagement.plist" new file mode 100644 index 0000000..f2941ac --- /dev/null +++ "b/21551047\351\273\204\351\221\253/MyOpenGL2.xcodeproj/xcuserdata/hxssg.xcuserdatad/xcschemes/xcschememanagement.plist" @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + MyOpenGL2.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + C4CA37A21C4CE7A400ADB272 + + primary + + + + + diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2/RGBpixmap.cpp" "b/21551047\351\273\204\351\221\253/MyOpenGL2/RGBpixmap.cpp" new file mode 100755 index 0000000..8ff87a1 --- /dev/null +++ "b/21551047\351\273\204\351\221\253/MyOpenGL2/RGBpixmap.cpp" @@ -0,0 +1,115 @@ +// RGBpixmap.cpp - routines to read a BMP file +#include "RGBpixmap.h" + +typedef unsigned short ushort; +typedef unsigned long ulong; +fstream inf; // global in this file for convenience + +//<<<<<<<<<<<<<<<<<<<<< getShort >>>>>>>>>>>>>>>>>>>> +ushort getShort() //helper function +{ //BMP format uses little-endian integer types + // get a 2-byte integer stored in little-endian form + char ic; + ushort ip; + inf.get(ic); ip = ic; //first byte is little one + inf.get(ic); ip |= ((ushort)ic << 8); // or in high order byte + return ip; +} +//<<<<<<<<<<<<<<<<<<<< getLong >>>>>>>>>>>>>>>>>>> +ulong getLong() //helper function +{ //BMP format uses little-endian integer types + // get a 4-byte integer stored in little-endian form + ulong ip = 0; + char ic = 0; + unsigned char uc = ic; + inf.get(ic); uc = ic; ip = uc; + inf.get(ic); uc = ic; ip |=((ulong)uc << 8); + inf.get(ic); uc = ic; ip |=((ulong)uc << 16); + inf.get(ic); uc = ic; ip |=((ulong)uc << 24); + return ip; + } +//<<<<<<<<<<<<<<<<<< RGBPixmap:: readBmpFile>>>>>>>>>>>>> +int RGBpixmap:: readBMPFile(string fname, bool hasAlpha) //读取BMP文件 +{ + // Read into memory an mRGB image from + // an uncompressed BMP file. + // Return 0 on failure, 1 on success + inf.open(fname.c_str(), ios::in|ios::binary); //read binary char's + if(!inf) { + cout << " can't open file: " << fname << endl; + return 0; + } + int k, row, col, numPadBytes, nBytesInRow; + + // read the file header information + char ch1, ch2; + inf.get(ch1); + inf.get(ch2); //type: always 'BM' + ulong fileSize = getLong(); + ushort reserved1 = getShort(); // always 0 + ushort reserved2 = getShort(); // always 0 + ulong offBits = getLong(); // offset to image - unreliable + ulong headerSize = getLong(); // always 40 + ulong numCols = getLong(); // number of columns in image + ulong numRows = getLong(); // number of rows in image + ushort planes = getShort(); // always 1 + ushort bitsPerPixel = getShort(); //8 or 24; allow 24 here + ulong compression = getLong(); // must be 0 for uncompressed + ulong imageSize = getLong(); // total bytes in image + ulong xPels = getLong(); // always 0 + ulong yPels = getLong(); // always 0 + ulong numLUTentries = getLong(); // 256 for 8 bit, otherwise 0 + ulong impColors = getLong(); // always 0 + + if(bitsPerPixel != 24) + { + // error - must be a 24 bit uncompressed image + cout << "not a 24 bit/pixelimage, or is compressed!\n"; + inf.close(); + return 0; + } + + // Add bytes at end of each row so + // total # is a multiple of 4; + // round up 3*numCols to next mult. of 4 + nBytesInRow = ((3 * numCols + 3)/4) * 4; + numPadBytes = nBytesInRow - 3 * numCols; // need this many + nRows = numRows; // set class's data members + nCols = numCols; + pixel = new mRGB[nRows * nCols]; //make space for array + if (!pixel) + return 0; // out of memory! + + long count = 0; + char dum; + for(row = 0; row < nRows; row++) // read pixel values + { + for(col = 0; col < nCols; col++) + { + char r,g,b; + inf.get(b); + inf.get(g); + inf.get(r); //read bytes + pixel[count].r = r; //place them in colors + pixel[count].g = g; + pixel[count].b = b; + if ( (hasAlpha) && (r==-1) && (g==-1) && (b==-1) ) + pixel[count++].a = 0; + else + pixel[count++].a = 255; + } + for(k = 0; k < numPadBytes ; k++) //skip pad bytes at row's end + inf >> dum; + } + inf.close(); + return 1; +} + +void RGBpixmap :: setTexture(GLuint textureName) +{ + glBindTexture(GL_TEXTURE_2D,textureName); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, nCols, nRows,0, GL_RGBA, GL_UNSIGNED_BYTE, pixel); +} + diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2/RGBpixmap.h" "b/21551047\351\273\204\351\221\253/MyOpenGL2/RGBpixmap.h" new file mode 100755 index 0000000..faa5fd1 --- /dev/null +++ "b/21551047\351\273\204\351\221\253/MyOpenGL2/RGBpixmap.h" @@ -0,0 +1,176 @@ +#ifndef _RGBPIXMAP + #define _RGBPIXMAP +#if defined(_WIN32) +#include +#else +#include +#endif +#include +#include +#include +#include + +using namespace std; + +//@@@@@@@@@@@@@@@@@@ IntPoint class @@@@@@@@@@@@@@@@ +class IntPoint +{ + // for 2D points with integer coordinates +public: + int x,y; + void set(int dx, int dy){x = dx; y = dy;} + void set(IntPoint& p){ x = p.x; y = p.y;} + IntPoint(int xx, int yy){x = xx; y = yy;} + IntPoint(){ x = y = 0;} +}; + +//@@@@@@@@@@@@@@@@@@ Point2 class @@@@@@@@@@@@@@@@ +class Point2 +{ + // for 2D points with real coordinates +public: + float x,y; + void set(float dx, float dy){x = dx; y = dy;} + void set(Point2& p){ x = p.x; y = p.y;} + Point2(float xx, float yy){x = xx; y = yy;} + Point2(){x = y = 0;} +}; + +//<<<<<<<<<<<<<<<<<<<<<< PolyLine >>>>>>>>>>>>>>>>>>>>>>>>> +class PolyLine +{ + // a polyline is a num plus an array of points +public: + int num; + Point2 pt[80]; //may need larger arrays in some circumstances + PolyLine(){num = 0;} +}; + +// @@@@@@@@@@@@@@@@@@@@@@@@ IntRect class @@@@@@@@@@@@@@@@@@@@ +class IntRect +{ + // a rectangle with integer border values +public: + int left, top, right, bott; + IntRect(){left = top = right = bott = 0;} + IntRect(int l, int t, int r, int b) + {left = l; top = t; right = r; bott = b;} + void set(int l, int t, int r, int b) + {left = l; top = t; right = r; bott = b;} + void set(IntRect& r) + {left = r.left; top = r.top; right = r.right; bott = r.bott;} +}; + + +// RGBpixmap.h: a class to support working with RGB pixmaps. + + +typedef unsigned char uchar; + +class mRGB +{ + // the name RGB is already used by Windows +public: uchar r,g,b,a; + mRGB(){r = g = b = 0; a = 255;} + mRGB(mRGB& p){r = p.r; g = p.g; b = p.b; a = p.a;} + mRGB(uchar rr, uchar gg, uchar bb){r = rr; g = gg; b = bb; + if ( (r==255) && (g==255) && (b==255)) a = 0; else a = 255;} + mRGB(uchar rr, uchar gg, uchar bb, uchar aa){r = rr; g = gg; b = bb; a = aa;} + void set(uchar rr, uchar gg, uchar bb){r = rr; g = gg; b = bb; + if ( (r==255) && (g==255) && (b==255)) a = 0; else a = 255;} + void set(uchar rr, uchar gg, uchar bb, uchar aa){r = rr; g = gg; b = bb; a = aa;} +}; + +//$$$$$$$$$$$$$$$$$ RGBPixmap class $$$$$$$$$$$$$$$ +class RGBpixmap +{ +private: + mRGB* pixel; // array of pixels + +public: + int nRows, nCols; // dimensions of the pixmap + RGBpixmap() {nRows = nCols = 0; pixel = 0;} + RGBpixmap(int rows, int cols) //constructor + { + nRows = rows; + nCols = cols; + pixel = new mRGB[rows*cols]; + } + + int readBMPFile(string fname, bool hasAlpha); // read BMP file into this pixmap + void setTexture(GLuint textureName); + + void freeIt() // give back memory for this pixmap + { + delete []pixel; nRows = nCols = 0; + } + + //<<<<<<<<<<<<<<<<<< copy >>>>>>>>>>>>>>>>>>> + void copy(IntPoint from, IntPoint to, int x, int y, int width, int height) + { + // copy a region of the display back onto the display + if(nRows == 0 || nCols == 0) return; + glCopyPixels(x, y, width, height,GL_COLOR); + } + + //<<<<<<<<<<<<<<<<<<< draw >>>>>>>>>>>>>>>>> + void draw() + { + // draw this pixmap at current raster position + if(nRows == 0 || nCols == 0) return; + + //tell OpenGL: dont align pixels to 4 byte boundaries in memory + glPixelStorei(GL_UNPACK_ALIGNMENT,1); + glDrawPixels(nCols, nRows,GL_RGBA, GL_UNSIGNED_BYTE,pixel); + } + + //<<<<<<<<<<<<<<<<< read >>>>>>>>>>>>>>>> + int read(int x, int y, int wid, int ht) + { + // read a rectangle of pixels into this pixmap + nRows = ht; + nCols = wid; + pixel = new mRGB[nRows *nCols]; + if(!pixel) return -1; + + //tell OpenGL: dont align pixels to 4 byte boundaries in memory + glPixelStorei(GL_PACK_ALIGNMENT,1); + glReadPixels(x, y, nCols, nRows, GL_RGBA,GL_UNSIGNED_BYTE,pixel); + return 0; + } + + //<<<<<<<<<<<<<<<<< read from IntRect >>>>>>>>>>>>>>>> + int read(IntRect r) + { + // read a rectangle of pixels into this pixmap + nRows = r.top - r.bott; + nCols = r.right - r.left; + pixel = new mRGB[nRows *nCols]; + if(!pixel) return -1; + + //tell OpenGL: dont align pixels to 4 byte boundaries in memory + glPixelStorei(GL_PACK_ALIGNMENT,1); + glReadPixels(r.left,r.bott, nCols, nRows, GL_RGBA, GL_UNSIGNED_BYTE, pixel); + return 0; + } + + //<<<<<<<<<<<<<< setPixel >>>>>>>>>>>>> + void setPixel(int x, int y, mRGB color) + { + if(x>=0 && x =0 && y < nRows) + pixel[nCols * y + x] = color; + } + + //<<<<<<<<<<<<<<<< getPixel >>>>>>>>>>> + mRGB getPixel(int x, int y) + { + mRGB bad(255,255,255); + assert(x >= 0 && x < nCols); + assert(y >= 0 && y < nRows); + return pixel[nCols * y + x]; + } +}; //end of class RGBpixmap +#endif + + + diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2/SolarSystemGlobals.h" "b/21551047\351\273\204\351\221\253/MyOpenGL2/SolarSystemGlobals.h" new file mode 100755 index 0000000..56be277 --- /dev/null +++ "b/21551047\351\273\204\351\221\253/MyOpenGL2/SolarSystemGlobals.h" @@ -0,0 +1,59 @@ +///////////////////////////////////////////////////////// +// SolarSystemGlobals.h - Global Constant Definitions // +///////////////////////////////////////////////////////// + +#ifndef SOLAR_SYSTEM_GLOBALS_H + +/********************/ +/* Global Constants */ +/********************/ + +const GLfloat PI = 3.1415926535; +const GLfloat TO_RADIANS = PI/180.0; + +// Window Position/Resizing Constants +const GLint INIT_WINDOW_POSITION[2] = { 150, 150 }; +const GLfloat ASPECT_RATIO = 1.5; + +// Lighting Constants +const GLfloat LIGHT_0_POSITION[] = { 0.0, 0.0, 0.0, 1.0}; +const GLfloat LIGHT_1_POSITION[] = { 0.0, 0.0, 1.0, 0.0}; +const GLfloat LIGHT_2_POSITION[] = { 0.0, 0.0, 1.0, 0.0}; +const GLfloat LIGHT_3_POSITION[] = { 0.0, 0.0, -1.0, 0.0}; +const GLfloat LIGHT_AMBIENT[] = { 0.8, 0.8, 0.8, 1.0}; +const GLfloat LIGHT_DIFFUSE[] = { 0.9, 0.9, 0.9, 1.0}; +const GLfloat LIGHT_SPECULAR[] = { 1.0, 1.0, 1.0, 1.0}; +const GLfloat LIGHT_MODEL_AMBIENT[] = { 0.2, 0.2, 0.2, 1.0}; + +// Earth and Moon Constants +const char EARTH_BMP_FILENAME[] = ""; +const char MOON_BMP_FILENAME[] = ""; +const GLfloat EARTH_RADIUS = 0.54; +const GLfloat MOON_RADIUS = 0.12; +const GLfloat MOON_ORBIT_RADIUS = 0.90; +const GLfloat EARTH_ROTATION = 1.00; +const GLfloat LUNAR_CYCLE = 5.0; + +// Viewer Positioning Constants +const GLfloat MAXIMUM_VIEWER_DISTANCE = 20; +const GLfloat MINIMUM_VIEWER_DISTANCE = 2; +const GLfloat INITIAL_VIEWER_DISTANCE = 5; +const GLfloat VIEWER_DISTANCE_INCREMENT = 0.1; +const GLfloat INITIAL_VIEWER_AZIMUTH = 0.0; +const GLfloat INITIAL_VIEWER_ZENITH = PI / 2.0; +const GLfloat VIEWER_ANGLE_INCREMENT = PI / 1.0; +const GLfloat LOOK_AT_POSITION[] = { 0.0, 0.0, 0.0 }; + +const char SUN_BMP_FILENAME[] = ""; + +const GLfloat SUN_RADIUS = 1.0;//太阳半径 + +const GLfloat EARTH_ORBIT_RADIUS = 3.0;//地球公转半径 + +const GLfloat EARTH_ORBIT_DUR= 36;//地球一年日期 + +const GLfloat EARTH_INCLINATION = 7; + + +#define SOLAR_SYSTEM_H +#endif \ No newline at end of file diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2/earthmap.bmp" "b/21551047\351\273\204\351\221\253/MyOpenGL2/earthmap.bmp" new file mode 100755 index 0000000..1c889b7 Binary files /dev/null and "b/21551047\351\273\204\351\221\253/MyOpenGL2/earthmap.bmp" differ diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2/main.cpp" "b/21551047\351\273\204\351\221\253/MyOpenGL2/main.cpp" new file mode 100644 index 0000000..1f26da7 --- /dev/null +++ "b/21551047\351\273\204\351\221\253/MyOpenGL2/main.cpp" @@ -0,0 +1,336 @@ +// +// main.cpp +// MyOpenGL2 +// +// Created by Xin on 18/1/2016. +// Copyright © 2016 Huang Xin. All rights reserved. +// + +#if defined(_WIN32) +#include "glut.h" +#include +#else +#include +#endif + +#include +#include "RGBpixmap.h" +#include "SolarSystemGlobals.h" + + +// Viewer positioning angles. +GLfloat viewerAzimuth = INITIAL_VIEWER_AZIMUTH; +GLfloat viewerZenith = INITIAL_VIEWER_ZENITH; + +// ID numbers for all texture maps. +//GLuint ParticleTextureName = -1; +GLuint EarthTextureName = 3; +GLuint MoonTextureName = 4; +GLuint SunTextureName = 0; + + +// Variables to keep track of current day status. +GLfloat CurrentEarthRotation = 0.00; +GLfloat EarthDaysTranspired = 0.00; +GLfloat EarthDayIncrement = 0.05; + +// The initial window and viewport sizes (in pixels), set to ensure that +// the aspect ration for the viewport, will be a constant. If the window +// is resized, the viewport will be adjusted to preserve the aspect ratio. +GLint currWindowSize[2] = { 800, 600 }; +GLint currViewportSize[2] = { 800, 600 }; + +GLfloat ViewerDistance = INITIAL_VIEWER_DISTANCE; + +//ParticleSystem particles; +//bool particleFlag = true; +bool blendFlag = true; + +void TimerFunction(int value); +void Display(); + +void MakeAllImages(); +void MakeImage(const char bitmapFilename[], GLuint &textureName, bool hasAlpha); + +void SetLights(); +void UpdateLight(); + +void ResizeWindow(GLsizei w, GLsizei h); + +void drawEarthAndMoon(); +void drawSun(); +//void drawSaturnRing(); +void drawAllPlanets(); +void drawGenericPlanet(GLfloat inclination, GLfloat orbitDuration, + GLfloat orbitRadius, GLfloat rotationDuration, GLuint texturename, GLfloat radius); +// The main function sets up the data and the // +// environment to display the textured objects. // +int main(int argc, char** argv) +{ + glutInit (&argc, argv);//初始化 + + // Set up the display window. + glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_STENCIL | GLUT_DEPTH );//设定显示模式 + glutInitWindowPosition( INIT_WINDOW_POSITION[0], INIT_WINDOW_POSITION[1] );//位置 + glutInitWindowSize( currWindowSize[0], currWindowSize[1] );//大小 + glutCreateWindow( "太阳系");//窗口名称 + + // Specify the resizing and refreshing routines. + glutReshapeFunc( ResizeWindow ); + glutDisplayFunc( Display ); + glutTimerFunc( 20, TimerFunction, 1 ); + glViewport(0, 0, currWindowSize[0], currWindowSize[1]); + + // Set up standard lighting, shading, and depth testing. + glShadeModel(GL_SMOOTH); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations + glEnable(GL_NORMALIZE); + glCullFace(GL_BACK); + glEnable(GL_CULL_FACE); + glClearColor(0.0, 0.0, 0.0, 0.0); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + SetLights(); + + // Set up all texture maps and texture-mapped objects. + MakeAllImages(); + glutMainLoop(); + return 0; +} + +// Function to react to ASCII keyboard keys pressed by the user. // +// +/- keys are used to accelerate/decelerate the animation, while // +// the z/Z keys are used to zoom in and out of the animation. // +void KeyboardPress(unsigned char pressedKey, int mouseXPosition, int mouseYPosition) +{ +} + +// Function to react to non-ASCII keyboard keys pressed by the user. // +// Used to alter spherical coordinates of the viewer's position. // +void NonASCIIKeyboardPress(int pressedKey, int mouseXPosition, int mouseYPosition) +{ + glutIgnoreKeyRepeat(false); + switch(pressedKey) + { + case GLUT_KEY_RIGHT: { + viewerAzimuth += VIEWER_ANGLE_INCREMENT; + if (viewerAzimuth > 2*PI) + viewerAzimuth -= 2*PI; + break; + } + case GLUT_KEY_LEFT: { + viewerAzimuth -= VIEWER_ANGLE_INCREMENT; + if (viewerAzimuth < 0.0) + viewerAzimuth += 2*PI; + break; + } + case GLUT_KEY_UP: { + viewerZenith -= VIEWER_ANGLE_INCREMENT; + if (viewerZenith < VIEWER_ANGLE_INCREMENT) + viewerZenith = VIEWER_ANGLE_INCREMENT; + break; + } + case GLUT_KEY_DOWN: { + viewerZenith += VIEWER_ANGLE_INCREMENT; + if (viewerZenith > PI - VIEWER_ANGLE_INCREMENT) + viewerZenith = PI - VIEWER_ANGLE_INCREMENT; + break; + } + } +} + +// The EarthDayIncrement represents the fraction of an // +// Earth day being added to the scene in one screen update. // +void TimerFunction(int value) +{ + CurrentEarthRotation += EarthDayIncrement; + EarthDaysTranspired += EarthDayIncrement; + if (EarthDaysTranspired == EARTH_ORBIT_DUR) + EarthDaysTranspired = 0; + glutPostRedisplay(); + glutTimerFunc(20, TimerFunction, 1); +} + +// Principal display routine: sets up material, lighting, // +// and camera properties, clears the frame buffer, and // +// draws all texture-mapped objects within the window. // +void Display() +{ + // Initialize lighting. + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, LIGHT_MODEL_AMBIENT); + glEnable(GL_LIGHTING); + + // Set up the properties of the viewing camera. + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, ASPECT_RATIO, 0.2, 100.0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT| GL_STENCIL_BUFFER_BIT); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + // Position and orient viewer. + gluLookAt(LOOK_AT_POSITION[0] + ViewerDistance * sin(viewerZenith) * sin(viewerAzimuth), + LOOK_AT_POSITION[1] + ViewerDistance * cos(viewerZenith), + LOOK_AT_POSITION[2] + ViewerDistance * sin(viewerZenith) * cos(viewerAzimuth), + LOOK_AT_POSITION[0], LOOK_AT_POSITION[1], LOOK_AT_POSITION[2], + 0.0, 1.0, 0.020); + + // Render scene. + UpdateLight(); + drawEarthAndMoon(); + drawSun(); + + if(blendFlag){ //if the user has selected blending, enable it. + glEnable(GL_BLEND); + glDepthMask(GL_FALSE); + glBlendFunc(GL_SRC_COLOR,GL_ONE); + } + + glDepthMask(GL_TRUE); + glDisable(GL_BLEND); + glDisable(GL_LIGHTING); + glutSwapBuffers(); + glFlush(); +} + +// Create the textures associated with all texture-mapped objects being displayed. // +void MakeAllImages() +{ + MakeImage(EARTH_BMP_FILENAME, EarthTextureName, false); + MakeImage(MOON_BMP_FILENAME, MoonTextureName, false); + MakeImage(SUN_BMP_FILENAME, SunTextureName, false); + return; +} + + +// Convert the bitmap with the parameterized name into an OpenGL texture. // +void MakeImage(const char bitmapFilename[], GLuint &textureName, bool hasAlpha) +{ + RGBpixmap pix; + pix.readBMPFile(bitmapFilename, hasAlpha); + pix.setTexture(textureName); + return; +} + + +// Set the two lights to illuminate the scene. // +void SetLights() +{ + glLightfv(GL_LIGHT0, GL_AMBIENT, LIGHT_AMBIENT); + glLightfv(GL_LIGHT0, GL_DIFFUSE, LIGHT_DIFFUSE); + glLightfv(GL_LIGHT0, GL_SPECULAR, LIGHT_SPECULAR); + glLightfv(GL_LIGHT0, GL_POSITION, LIGHT_0_POSITION); + + glLightfv(GL_LIGHT1, GL_AMBIENT, LIGHT_AMBIENT); + glLightfv(GL_LIGHT1, GL_DIFFUSE, LIGHT_DIFFUSE); + glLightfv(GL_LIGHT1, GL_SPECULAR, LIGHT_SPECULAR); + glLightfv(GL_LIGHT1, GL_POSITION, LIGHT_1_POSITION); +} + + +// Enable the scene's lighting. // +void UpdateLight() +{ + glPushMatrix(); + glLightfv(GL_LIGHT0, GL_POSITION, LIGHT_0_POSITION); + glLightfv(GL_LIGHT1, GL_POSITION, LIGHT_1_POSITION); + glLightfv(GL_LIGHT2, GL_POSITION, LIGHT_2_POSITION); + glLightfv(GL_LIGHT3, GL_POSITION, LIGHT_3_POSITION); + glPopMatrix(); + + glEnable(GL_LIGHT0); + glEnable(GL_LIGHT1); +} + +// Window-reshaping callback, adjusting the viewport to be as large // +// as possible within the window, without changing its aspect ratio. // +void ResizeWindow(GLsizei w, GLsizei h) +{ + currWindowSize[0] = w; + currWindowSize[1] = h; + if (ASPECT_RATIO > w/h) + { + currViewportSize[0] = w; + currViewportSize[1] = w / ASPECT_RATIO; + } + else + { + currViewportSize[1] = h; + currViewportSize[0] = h * ASPECT_RATIO; + } + + glViewport(0.5*(w-currViewportSize[0]), 0.5*(h-currViewportSize[1]), currViewportSize[0], currViewportSize[1]); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + //glTranslatef(0.0, 0.0, -20.0); + gluPerspective(60.0, (GLfloat)w / (GLfloat)h, 0.1, 100.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + + +//Draws the texture-mapped earth and moon. // +void drawEarthAndMoon() +{ + glDisable(GL_LIGHT1); + + GLfloat MoonRevolution = EarthDaysTranspired / LUNAR_CYCLE; + GLUquadricObj* quadro = gluNewQuadric(); + gluQuadricNormals(quadro, GLU_SMOOTH); + gluQuadricTexture(quadro, GL_TRUE); + glEnable(GL_TEXTURE_2D); + glPushMatrix(); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glPushMatrix(); + glRotatef(EARTH_INCLINATION, 0.0, 0.0, 0.0); + glRotatef( 360.0 * (EarthDaysTranspired/EARTH_ORBIT_DUR), 0.0, 1.0, 0.0); + glTranslatef(EARTH_ORBIT_RADIUS, 0.0, 0.0 ); + glRotatef( 360.0 * CurrentEarthRotation, 0.0, 1.0, 0.0 ); + glRotatef( -90.0, 1.0, 0.0, 0.0 ); + glBindTexture(GL_TEXTURE_2D, EarthTextureName); + gluSphere(quadro, EARTH_RADIUS, 48, 48); + glPopMatrix(); + glRotatef(EARTH_INCLINATION, 0.0, 0.0, 0.0); + glRotatef( 360.0 * (EarthDaysTranspired/EARTH_ORBIT_DUR), 0.0, 1.0, 0.0); + glTranslatef(EARTH_ORBIT_RADIUS, 0.0, 0.0 ); + glRotatef( 360.0 * MoonRevolution, 0.0, 1.0, 0.0 ); + glTranslatef( MOON_ORBIT_RADIUS , 0.0, 0.0 ); + glBindTexture(GL_TEXTURE_2D, MoonTextureName); + gluSphere(quadro, MOON_RADIUS, 48, 48); + glPopMatrix(); + glDisable(GL_TEXTURE_2D); + gluDeleteQuadric(quadro); + + glEnable(GL_LIGHT1); +} + +//Function to draw and texture map the sun at the origin +void drawSun() +{ + glDisable(GL_LIGHT0); + + GLUquadricObj* quadro = gluNewQuadric(); + gluQuadricNormals(quadro, GLU_SMOOTH); + gluQuadricTexture(quadro, GL_TRUE); + glEnable(GL_TEXTURE_2D); + glPushMatrix(); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glPushMatrix(); + + glRotatef(EARTH_INCLINATION, 0.0, 0.0, 0.0); + glRotatef( 360.0 * (EarthDaysTranspired/EARTH_ORBIT_DUR), 0.0, 1.0, 0.0); + glRotatef( 360.0 * 0, 0.0, 1.0, 0.0 ); + + //glRotatef( -90.0, 1.0, 0.0, 0.0 ); + glBindTexture(GL_TEXTURE_2D, SunTextureName); + gluSphere(quadro, SUN_RADIUS, 48, 48); + glPopMatrix(); + glPopMatrix(); + glDisable(GL_TEXTURE_2D); + gluDeleteQuadric(quadro); + + glEnable(GL_LIGHT0); +} + diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2/moonmap.bmp" "b/21551047\351\273\204\351\221\253/MyOpenGL2/moonmap.bmp" new file mode 100755 index 0000000..12c31b4 Binary files /dev/null and "b/21551047\351\273\204\351\221\253/MyOpenGL2/moonmap.bmp" differ diff --git "a/21551047\351\273\204\351\221\253/MyOpenGL2/sunmap.bmp" "b/21551047\351\273\204\351\221\253/MyOpenGL2/sunmap.bmp" new file mode 100755 index 0000000..d9b87db Binary files /dev/null and "b/21551047\351\273\204\351\221\253/MyOpenGL2/sunmap.bmp" differ diff --git "a/21551047\351\273\204\351\221\253/\350\257\273\344\271\246\346\212\245\345\221\212/21551047_\351\273\204\351\221\253_\350\257\273\344\271\246\346\212\245\345\221\212_\345\237\272\344\272\216GPU\347\232\204\345\271\266\350\241\214\350\256\241\347\256\227\350\256\276\350\256\241\344\270\216\345\210\206\346\236\220.docx" "b/21551047\351\273\204\351\221\253/\350\257\273\344\271\246\346\212\245\345\221\212/21551047_\351\273\204\351\221\253_\350\257\273\344\271\246\346\212\245\345\221\212_\345\237\272\344\272\216GPU\347\232\204\345\271\266\350\241\214\350\256\241\347\256\227\350\256\276\350\256\241\344\270\216\345\210\206\346\236\220.docx" index 24b5a7c..079626e 100644 Binary files "a/21551047\351\273\204\351\221\253/\350\257\273\344\271\246\346\212\245\345\221\212/21551047_\351\273\204\351\221\253_\350\257\273\344\271\246\346\212\245\345\221\212_\345\237\272\344\272\216GPU\347\232\204\345\271\266\350\241\214\350\256\241\347\256\227\350\256\276\350\256\241\344\270\216\345\210\206\346\236\220.docx" and "b/21551047\351\273\204\351\221\253/\350\257\273\344\271\246\346\212\245\345\221\212/21551047_\351\273\204\351\221\253_\350\257\273\344\271\246\346\212\245\345\221\212_\345\237\272\344\272\216GPU\347\232\204\345\271\266\350\241\214\350\256\241\347\256\227\350\256\276\350\256\241\344\270\216\345\210\206\346\236\220.docx" differ diff --git "a/21551047\351\273\204\351\221\253/\350\257\273\344\271\246\346\212\245\345\221\212/Improving Performance of GPU Specific OpenCL Program on CPUs.pdf" "b/21551047\351\273\204\351\221\253/\350\257\273\344\271\246\346\212\245\345\221\212/Improving Performance of GPU Specific OpenCL Program on CPUs.pdf" index 01d8117..ba7949e 100644 Binary files "a/21551047\351\273\204\351\221\253/\350\257\273\344\271\246\346\212\245\345\221\212/Improving Performance of GPU Specific OpenCL Program on CPUs.pdf" and "b/21551047\351\273\204\351\221\253/\350\257\273\344\271\246\346\212\245\345\221\212/Improving Performance of GPU Specific OpenCL Program on CPUs.pdf" differ